Compare Similar npm Packages
react vs vue vs @angular/core vs svelte vs solid-js vs alpinejs
1 Year
reactvue@angular/coresveltesolid-jsalpinejsSimilar Packages:
Package Weekly Downloads Trend
Github Stars Ranking
Stat Detail
Package
Downloads
Stars
Size
Issues
Publish
License
react38,966,779236,249167 kB1,0512 months agoMIT
vue6,367,12250,4502.4 MB1,05514 days agoMIT
@angular/core3,749,45998,1139.97 MB1,55223 minutes agoMIT
svelte1,874,29283,0252.49 MB789a day agoMIT
solid-js586,02433,7481.04 MB130a month agoMIT
alpinejs256,23629,795544 kB413 months agoMIT
README for react

react

React is a JavaScript library for creating user interfaces.

The react package contains only the functionality necessary to define React components. It is typically used together with a React renderer like react-dom for the web, or react-native for the native environments.

Note: by default, React will be in development mode. The development version includes extra warnings about common mistakes, whereas the production version includes extra performance optimizations and strips all error messages. Don't forget to use the production build when deploying your application.

Usage

import { useState } from 'react';
import { createRoot } from 'react-dom/client';

function Counter() {
  const [count, setCount] = useState(0);
  return (
    <>
      <h1>{count}</h1>
      <button onClick={() => setCount(count + 1)}>
        Increment
      </button>
    </>
  );
}

const root = createRoot(document.getElementById('root'));
root.render(<Counter />);

Documentation

See https://react.dev/

API

See https://react.dev/reference/react