Preact vs. React

Summarize this blog post with:

TL;DR: React vs Preact performance comes down to size vs capability. React is ideal for complex apps with advanced features and a rich ecosystem, while Preact delivers significantly smaller bundles (~3–4 KB) and faster load times, making it perfect for performance-critical apps, landing pages, and low-bandwidth users. Choose based on whether you need power or speed.

Choosing between Preact and React isn’t just a technical decision, it directly impacts your app’s performance, bundle size, and user experience.

If you’ve ever wondered:

  • Is React too heavy for my project?
  • Will Preact actually improve performance?
  • Can I switch without breaking my app?

You’re not alone.

This guide breaks down the real differences between Preact and React, with a strong focus on performance, bundle size, and real-world impact, so you can confidently choose the right tool.

Preact vs React: Quick Answer

  • Use React if you need advanced features like Server Components, Concurrent Rendering, and a large ecosystem
  • Use Preact if you prioritize performance, smaller bundle size, and faster load times

React = ecosystem + advanced capabilities
Preact = speed + lightweight performance

What is React?

React is a JavaScript library for building user interfaces through composable, reusable components using JSX and Hooks.

Where it’s used: Single-page applications, complex dashboards, e-commerce platforms, social networks, enterprise software, and mobile apps via React Native.

Why developers choose React

  • Component composition with JSX.
  • Hooks for state and side effects (useStateuseEffect).
  • Context API for dependency injection.
  • Suspense for code-splitting and data fetching.
  • Server Components for zero-bundle-impact server logic.
  • Concurrent Rendering for prioritized updates.
  • Comprehensive DevTools and profiler.

Syncfusion React UI components are the developers’ choice to build user-friendly web applications. You deserve them too.

What is Preact?

Preact is a 3 KB alternative to React that implements the same component-based model, JSX, Hooks, and Context while stripping away internal complexity to achieve a tiny footprint. It is not a reimplementation of React; it is a targeted fix for React’s performance and size bottlenecks. A compatibility layer (preact/compat) lets you use most React libraries by aliasing imports in your bundler.

Where it’s used: Landing pages, marketing sites, progressive web apps, embeddable widgets, micro frontends, and any project where first-load performance is critical.

Why developers choose Preact

  • Components and JSX (identical API)
  • All common Hooks (via preact/hooks)
  • Context API
  • Lazy loading and code-splitting
  • Server-side rendering
  • preact/compat for React ecosystem compatibility
  • Preact DevTools

React vs Preact performance: What really matters?

When comparing Preact vs React performance, the key factors are bundle size, rendering strategy, and runtime overhead.

In real-world applications, this affects:

  • First load time
  • JavaScript execution cost
  • Core Web Vitals (LCP, TTI)
  • Performance on low-end devices

Key differences between Preact and React

Each difference below follows the same structure: what React does, what Preact does, and the practical impact

1. Bundle size

  • React: ~42 KB (minified + gzipped)
  • Preact: ~3–4 KB (minified + gzipped)
  • Impact: Preact is ~10× smaller, resulting in faster load times, lower parse cost, and better Core Web Vitals scores, especially on slow networks and low-end devices.

2. Events

  • React: Uses a synthetic event system that wraps native browser events to normalize behavior across all browsers.
  • Preact: Uses the browser’s native addEventListener directly, no synthetic wrapper.
  • Impact: Preact is closer to vanilla JS behavior. Some React libraries that depend on synthetic events may behave differently.

Key behavioral differences in Preact:

  • Use onInput instead of onChange on form elements
  • Use onDblClick (standard DOM) instead of onDoubleClick
  • Events do not bubble up through components
// React
<input onChange={e => console.log(e.target.value)} />

// Preact
<input onInput={e => console.log(e.target.value)} />

3. Hooks

  • React: Hooks are part of the core bundle.
  • Preact: Hooks are separated into preact/hooks to keep the core bundle minimal. Import them explicitly.
  • Impact: No API difference, the same Hooks work the same way. Only the import path changes.
// React
import { useState, useEffect } from 'react';

// Preact
import { useState, useEffect } from 'preact/hooks';

4. Rendering architecture

  • React: Uses Fiber architecture with work prioritization, can pause, resume, and interrupt renders.
  • Preact: Uses a simple, synchronous virtual DOM diff optimized for size and speed.
  • Impact: React handles complex, high-frequency UI updates better. Preact is faster for typical workloads that do not require Concurrent Rendering.

All Syncfusion’s 70+ React UI components are well-documented. Refer to them to get started quickly.

5. Native HTML attribute names

  • React: Requires className instead of class, and camelCased attribute names to match JavaScript conventions.
  • Preact: Follows the DOM specification, accepts class, for, and other native HTML attribute names directly in JSX.
  • Impact: Preact lets you copy HTML from designs or mockups without converting attribute names.
// React
<div className="foo" />

// Preact
<div class="foo" />

6. SVG inside JSX

  • React: SVG attributes must be camelCased (e.g., strokeWidthstrokeLinejoin).
  • Preact: SVG attributes use their native names, kebab-case is supported as-is.
  • Impact: Preact lets developers copy SVG snippets directly from design tools without manual conversion.
// React
<circle fill="none" strokeWidth="2" strokeLinejoin="round" />

// Preact
<circle fill="none" stroke-width="2" stroke-linejoin="round" />

7. render() method arguments

  • React: Class components access state and props via this.props and this.state.
  • Preact (without compat): The render() method receives props and state as direct arguments.
  • Impact: Minor convenience in Preact for class components. No difference when using preact/compat.
// React (and Preact with compat)
render() {
  return <div>
    Name: {this.props.name}, Count: {this.state.count}
  </div>;
}

// Preact without compat
render({ name }, { count }) {
  return <div>
    Name: {name}, Count: {count}
  </div>;
}

8. Children API

  • React: Provides a Children API (Children.countChildren.only, etc.) for interacting with props.children.
  • Preact: Uses built-in array methods and the toChildArray() utility instead.
  • Impact: No functional difference for most use cases. Libraries that use React’s Children API directly may need preact/compat.
// React
const cols = Children.count(props.children);

// Preact
const cols = toChildArray(props.children).length;

9. ES module support

  • React: Requires a bundler (Webpack, Vite, etc.) to use in a browser.
  • Preact: Designed with the ES module system in mind, it can be imported directly in the browser without a bundler.
  • Impact: Preact is usable in lightweight, no-build environments.

Refer to the code example:

<script type="module">
  import { h, render } from 'https://unpkg.com/preact?module';
  import htm from 'https://unpkg.com/htm?module';

  const html = htm.bind(h);

  render(
    html`<h1>Hello World!</h1>`,
    document.body
  );
</script>

10. Advanced features

  • React: Ships Server Components, Concurrent Rendering (useTransitionstartTransition), advanced Suspense for data fetching, and React Native support.
  • Preact: Does not support any of these. Suspense is limited to lazy component loading only.
  • Impact: If your project requires any of these features, React is the only option.

Feature comparison table

Feature

React

Preact

Components & JSX

✅ Full

✅ Full

Hooks

✅ Core bundle

✅ preact/hooks

Context API

✅ Full

✅ Full

Lazy loading / code-splitting

Suspense for data fetching

✅ React 18+

⚠️ Limited

Concurrent Rendering

✅ React 18+

Server Components

✅ React 18+

React Native

Server-Side Rendering

TypeScript

Native HTML attributes (class)

Native SVG attributes (kebab-case)

ES modules (no bundler)

React library compatibility

✅ Native

✅ Via preact/compat

Bundle size (min+gzip)

~42 KB

~3–4 KB

DevTools

React DevTools

Preact DevTools

Migrating an existing React app to Preact

If you’re considering Preact for performance reasons, the good news is that migrating from React is often straightforward, especially for standard applications.

Thanks to preact/compat, many React apps can run with minimal changes.

Step 1: Install Preact

npm install preact

npm install --save-dev @preact/preset-vite  # if using Vite

Step 2: Configure bundler aliases

For Webpack, update your resolve.alias section as shown in the code example below:

"resolve": {
  "alias": {
    "react": "preact/compat",
    "react-dom/test-utils": "preact/test-utils",
    "react-dom": "preact/compat",
    "react/jsx-runtime": "preact/jsx-runtime"
  }
}

Step 3: Test thoroughly

  • Run your full test suite; update test setup if needed
  • Test all user flows in the browser
  • Check for libraries that access React internals
  • Verify third-party components work correctly

Step 4: Watch for edge cases

  • Events: Synthetic event assumptions may need updates
  • Portals: Mostly compatible; verify usage
  • Refs: Should work; test forwarded refs
  • React-specific APIs: Not all are available in Preact

Step 5: Measure performance

Use Lighthouse, WebPageTest, or Core Web Vitals tools to verify bundle size reduction and performance improvements.

Be amazed exploring what kind of application you can develop using Syncfusion React components.

Creating a fresh Preact app

If you’re starting a new project and want to take advantage of Preact’s performance benefits from the beginning, setting up a new app is quick and straightforward.

Preact provides an official CLI that helps you scaffold projects with minimal setup.

npm install -g preact-cli
preact create default my-project

Available templates

Preact CLI includes multiple templates to suit different project needs:

TemplateDescription
defaultStandard Preact setup
simpleBlank setup with vanilla JS
typescriptSetup with TypeScript
materialMaterial Design template
netlifyNetlify CMS template
widgetEmbeddable widget setup

Developer experience

 StrengthsChallenges
React
  • Comprehensive docs with interactive examples.
  • Excellent error messages with actionable guidance.
  • React DevTools: component tree, props, profiler.
  • First-class framework support (Next.js, Remix).
  • Large community: tutorials, courses, Stack Overflow.
  • Larger bundle requires careful code-splitting
  • More concepts to learn (RSC, Concurrent patterns)
  • Can be overkill for simple projects
Preact
  • Familiar API if you know React
  • Fast dev builds and HMR due to tiny core
  • Less abstraction makes debugging simpler
  • Well-documented with a built-in CLI
  • Smaller community — fewer tutorials and examples
  • Some React libraries have compatibility quirks
  • Missing advanced React features may need workarounds
  • Preact DevTools less polished than React DevTools
 ProsCons
React
  • Massive ecosystem and community
  • Advanced features (RSC, Concurrent Mode)
  • Best-in-class framework integration
  • React Native for mobile development
  • Excellent documentation and error messages
  • Large talent pool and hiring market
  • Larger bundle (slower first load)
  • More complex mental model
  • Steeper learning curve for advanced patterns
  • Can be overkill for simple projects
Preact
  • Tiny bundle (~3 KB vs ~42 KB)
  • Faster loading, parsing, and rendering
  • React-like API — minimal relearning
  • Works with most React libraries via compat
  • Excellent for performance-critical apps
  • Simple mental model
  • No Server Components or Concurrent features
  • No React Native support
  • Smaller community and ecosystem
  • Occasional compatibility quirks
  • Less advanced tooling and framework support

Decision guide

Use case

Recommended

Reason

Large enterprise application

React

Advanced features, ecosystem, long-term support

Landing page or marketing site

Preact

Fast load times critical for conversion

Complex dashboard with real-time updates

React

Concurrent Rendering handles complexity better

Blog or documentation site

Preact

Simple architecture; speed matters for SEO

E-commerce product page

Preact

LCP and Core Web Vitals directly impact sales

Social media platform

React

Scale, ecosystem, potential React Native mobile app

Embeddable widget

Preact

Must be tiny to avoid slowing down the host page

Progressive Web App (PWA)

Preact

Bundle size critical for offline caching

Mobile app with React Native

React

Only React supports React Native

Server-rendered app with RSC

React

Server Components are React-only

Targeting slow networks / low-end devices

Preact

Every kilobyte matters

Team with deep React expertise

React

Leverage existing knowledge and hiring pool

Frequently Asked Questions

Can I switch from React to Preact later?

Yes. Add bundler aliases pointing to preact/compat and test your application. Many projects migrate with minimal code changes. Complex apps using React internals may require more work.

Do all React libraries work with Preact?

Most do via preact/compat, but not all. Libraries that access React internals, depend on synthetic events, or use experimental features may need adjustments. Test critical dependencies before committing to migration.

Is Preact production-ready?

Yes. Preact is mature, stable, and used in production by companies prioritizing performance. Uber is a notable example. It is well-maintained despite having a smaller community than React.

Does bundle size really matter?

Yes, especially for users on slow networks, low-end devices, emerging markets, and projects where Core Web Vitals are SEO ranking factors. Speed directly impacts conversion rates and business metrics.

Can I use Next.js with Preact?

Not directly. Next.js is built for React and uses React-specific features. For Preact SSR, use Preact CLI, Vite SSR, or a custom server-rendering setup.

Explore the endless possibilities with Syncfusion’s outstanding React UI components.

Conclusion

When comparing React vs Preact performance, the right choice ultimately depends on your project’s priorities.

Both libraries share the same core principles, component-based architecture, and Hooks, but they optimize for different goals:

  • Choose React for large-scale applications, advanced rendering capabilities, and access to a vast ecosystem
  • Choose Preact for performance-critical applications, faster load times, and smaller bundle sizes

In short, React offers flexibility and scalability, while Preact delivers speed and efficiency.

Instead of choosing based on popularity, focus on what your application truly needs, performance, features, or long-term scalability.

If you’re building modern web applications with React, Syncfusion Essential Studio® for React provides a comprehensive suite of high-performance, lightweight, and production-ready UI components to accelerate development.

Explore Syncfusion React components to build faster, more efficient applications.

For questions or support, feel free to connect with us through our support forumsupport portal, or feedback portal.

Be the first to get updates

Prashant YadavPrashant Yadav profile icon

Meet the Author

Prashant Yadav

Senior Frontend Engineer at Razorpay. On a journey to become Frontend Architect. Writes about JavaScript and Web development on learnersbucket.com

Leave a comment