react
An npm package to get you immediate access to [React](http://facebook.github.io/react/), without also requiring the JSX transformer. This is especially useful for cases where you want to [`browserify`](https://github.com/substack/node-browserify) your module using `React`.
Last updated 11 years ago by zpao .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install react 
SYNC missed versions from official npm registry.

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(<App />);

Documentation

See https://reactjs.org/

API

See https://reactjs.org/docs/react-api.html

Current Tags

  • 18.0.0-beta-24dd07bd2-20211208                                ...           beta (3 years ago)
  • 18.2.0                                ...           latest (2 years ago)
  • 18.3.0-next-8342a0992-20230327                                ...           next (2 years ago)
  • 18.0.0-rc.3                                ...           rc (3 years ago)

1494 Versions

Downloads
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None

Copyright 2013 - present © cnpmjs.org | Home |