Top 5 Alternatives to React in 2023 (2024)

Currently, React is extremely popular, and for good reasons. It is simple and concise. However, looking at some alternatives is a good idea too (check out this article on when to use React). In this article, we will check out various alternatives to React that range from a performance-optimized version to something with an entirely different API.

Top Alternatives To React

Solid.js

Solid.js is an up-and-coming framework that is significantly faster than React. In fact, Solid is one of the fastest frameworks available. Additionally, it provides an API that is very similar to React. Solid uses the same JSX as React does, and it has very similar hooks. However, there are some differences. For example, to optimize your code, Solid requires that when you try to get the value of state, you have to call the state as a function rather than just taking the value directly.

Code Example

import { render } from "solid-js/web";import { createSignal } from "solid-js";function Counter() {const [count, setCount] = createSignal(0);const increment = () => setCount(count() + 1);return (<><h1>{count()}</h1><button type="button" onClick={increment}>Increment</button></>);}render(() => <Counter />, document.body);

Preact

Preact is one of the best alternatives to React, as it is significantly faster, smaller (10kB minified), and offers React compatibility. Unlike most other libraries, Preact offers perfect React compatibility using preact/compat, which means that you can often transform a React app into a Preact app with minimal changes to your code. The simplest way to migrate from React to Preact is to alias React to preact/compat using a bundler or other build tool. What aliasing does is it redirects requests for React to preact/compat, meaning you can keep all of your React imports.

Code Example

/** @jsx h *//** @jsxFrag Fragment */import { h, Fragment, render } from "preact";import { useState } from "preact/hooks";const rootElement = document.getElementById("root");export default function Counter() {const [count, setCount] = useState(0);const increment = () => setCount(count + 1);return (<><h1>{count}</h1><button onClick={increment}>Increment</button></>);}render(<Counter />, document.body);

Svelte

Svelte is another well-known alternative that is popular due to not just its performance but also its concise syntax. Unlike the first three alternatives, Svelte has an entirely different syntax that will take some time to learn but is very enjoyable once you get the hang of it. Svelte achieves its performance and brevity using an advanced compiler that turns your Svelte code into native JavaScript. Svelte’s compiler enables you to ship tiny JavaScript bundles, as you don’t have to send any large libraries to the client.

Svelte code differs from React code in many important ways. First of all, Svelte components are Single File Components, which you might be familiar with if you have ever used Vue. Unlike React, where components are just functions or classes in a JavaScript/JSX file, Svelte components are more like HTML files in that there is no JavaScript shell around the markup. Instead, you must put JavaScript inside custom <script> tags. Another major difference is that you manage state using plain JavaScript syntax, rather than useState() and setX(). You can create a variable and use it within the markup, and the markup will automatically update. Finally, Svelte has its own syntax for control flow inside markup, relying on syntax like {#if condition}{/if} instead of nested functions.

If you want to learn more about Svelte as an alternative to React, check out React VS Svelte

Code Example

<script>let count = 0;function handleClick() {count++;}</script><h1>{count}</h1><button on:click="{handleClick}">Increment</button>

Hyperapp

Hyperapp is a very minimal and fast library for building reactive interfaces. Unlike the rest of the options on this list, Hyperapp makes you write your markup using HyperScript, which utilizes raw functions rather than something like HTML. HyperScript is like using raw React.createElement(), and comes with the advantage of not requiring a compiler. Hyperapp also has a minimal API for state and lifecycle events. All of this minimalism allows Hyperapp to be extremely small, at 4kB minified.

Code Example

import { h, text, app } from "hyperapp";const increment = (state) => ({...state,count: state.count + 1,});app({init: { count: 0 },view: ({ count }) =>h("main", {}, [h("h1", {}, text(count)),h("button", { onclick: increment }, text("Increment")),]),node: document.body,});

Mithril

Mithril is the final option on our list, and it is also a very good one, as it manages to strike a balance between React’s abstraction and Hyperapp’s minimalism. First, it supports both JSX and raw function calls. The primary way of constructing markup using Mithril is with raw functions, but it is compatible with Babel’s JSX compiler, so you cna do either. Second, Mithril has a more minimal automatic update system. The markup will only update after event handlers, HTTP requests using m.request(), and route changes. Otherwise, you can manually call m.redraw() to have Mithril update the markup. Otherwise, Mithril is a lot like Hyperapp with more features.

Code Example

import m from "https://esm.run/mithril";function counter() {let count = 0;function increment() {count++;}return {view: () => [m("h1", count),m("button", { onclick: increment }, "Increment"),],};}m.mount(document.body, counter);

Conclusion

That’s it! I hope you found a least one library here that you will try out. React is great for a lot of things, but not for everything. Personally, my favorites on this list are Svelte and Solid. Also, if you liked reading this, join the mailing list or subscribe to RSS below! Thanks for reading!

Top 5 Alternatives to React in 2023 (2024)

FAQs

Who are the competitors of React in 2023? ›

Some of the top alternatives to React, such as Svelte, Vue, and Preact, have similar size to React and are able to handle demanding apps.

What is the best alternative to React? ›

The Best Alternatives to React
TechnologyKey FeaturesAdvantages
BackboneJS– Key-value binding, declarative events– Lightweight, simple structure
CycleJS– Stream-based, drivers for side effects– Functional programming approach, reactive
jQuery– DOM manipulation, event handling– Easy to use, extensive plugin ecosystem
9 more rows

What is replacing React? ›

Via Lit. Lit is a lightweight alternative to React for building web components. Unlike React, it doesn't provide a complete framework but provides tools for building great UI. Lit offers alternatives to React components that are modular and easily maintainable, with efficient DOM manipulation.

Is React still relevant in 2023? ›

So, yes, React is still an excellent choice for web development in 2023. If you want the best React builds for your next web development project, then FiveRivers Technologies is always at your service.

Is React still popular in 2024? ›

Yes, React JS is still in high demand due to its popularity, robustness, and the large ecosystem of libraries and tools built around it.

What is faster than React? ›

Yes, SolidJS is better than React, because SolidJS delivers a faster developer experience that's comparable to React.

What is Microsoft alternative to React? ›

In conclusion, both Microsoft Blazor and React are powerful tools for creating state-of-the-art web apps. The selection of the framework depends upon the requirements of your project. Blazor may be the better option if you want to build quick and responsive web applications and are already comfortable with C# and .

Is svelte better than React? ›

When it comes to performance and satisfaction, Svelte outperforms React in every way. But if you're an experienced developer and are standing on firm ground already, React would be the best choice for you because it has a vast ecosystem in which finding resources and getting support will be far easier.

Which is better Python or React? ›

To sum it up, select Python if you need a versatile language that can handle a wide variety of tasks. Opt for React. js when your primary focus is on building engaging and responsive web user interfaces. Your decision should align with the specific requirements of your project, ensuring its success and efficiency.

Is React outdated? ›

React has been around for more than a decade, and during this time, it has become one of the most popular front-end frameworks in the world. Despite the constant influx of new frameworks and libraries in the JavaScript world, React's dominance remains unchallenged.

Is it worth learning React in 2024? ›

Mastering JavaScript, which is foundational for working with React, is part of the recommended path for new developers in 2024. React Ecosystem In 2024, React's vibrant ecosystem continues to flourish, offering a rich landscape of tools and libraries which can be very beneficial for developers.

What is next JS compared to React? ›

React is a flexible JavaScript library focused purely on building user interfaces, while Next. js is an opinionated framework that builds on React and provides extra functionality like server-side rendering and optimization features out of the box.

What is the best alternative to React 2023? ›

There are several lightweight alternatives to React in 2023. Some of the top ones include Vue. js, Angular, Svelte, Preact, and Ember. js.

Is React JS losing popularity? ›

Even though it lost its no. 1 position last year, we can't deny it's still a favored technology. Enterprises, end-users, and developers appreciate ReactJS for adding an interactive flow to websites, code reusability, and many other reasons.

Which is best angular or React in 2023? ›

According to the 2023 Stack Overflow Developer Survey, React reigns as the most favored web framework, boasting a formidable 40.58% of respondents' preference. Angular commands 17.46% of the pie, worth noting is Next. js (based on React), which is just slightly behind Angular with 16.67%.

What is more popular than React? ›

js and Vue. js have been listed as the Most Loved Web frameworks in the 2022 survey, with React being four places before Vue. React is now the 6th most loved web framework according to the 2022 Stack Overflow Survey survey results, with 68.19% of respondents saying they really like using it.

Should I learn Vue or React 2023? ›

Is Vue much better than React? No, Vue is not better than React. However, it is different from React and has its own strengths, weaknesses, and unique features. For example, Vue's simple syntax makes it easier for beginners to learn than React.

Who is the competitor of create React app? ›

  1. Vite.
  2. Next.js.
  3. Remix.
  4. Gatsby.
  5. Astro.
  6. Parcel.
  7. Nx.
  8. T3 Stack. CodeSandbox. StackBlitz.
Feb 21, 2024

Top Articles
Latest Posts
Article information

Author: Arielle Torp

Last Updated:

Views: 5606

Rating: 4 / 5 (61 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Arielle Torp

Birthday: 1997-09-20

Address: 87313 Erdman Vista, North Dustinborough, WA 37563

Phone: +97216742823598

Job: Central Technology Officer

Hobby: Taekwondo, Macrame, Foreign language learning, Kite flying, Cooking, Skiing, Computer programming

Introduction: My name is Arielle Torp, I am a comfortable, kind, zealous, lovely, jolly, colorful, adventurous person who loves writing and wants to share my knowledge and understanding with you.