Skip to content
A blazing fast React alternative, compatible with IE8 and React 16.
JavaScript TypeScript Other
Branch: master
Clone or download


Type Name Latest commit message Commit time
Failed to load latest commit information.
benchmarks chore: online example or result for all benchmarks Mar 23, 2018
browsers fix: ci can't start karma test Oct 14, 2019
packages test: one more scryRenderedComponentsWithType case Feb 3, 2020
.babelrc fix: multiple define event crash in some browsers Dec 6, 2017
.editorconfig update:events Mar 22, 2017
.eslintignore chore: eslint ignore devtools.js Sep 18, 2017
.eslintrc.js refactor: move nerv-server into packages Oct 24, 2017
.gitignore chore: add benchmark build file to codebase Mar 23, 2018
.travis.yml chore: try to fix ci Sep 26, 2019 chore(release): publish v1.3.2-beta.0 Jul 13, 2018
LICENSE Initial commit Mar 22, 2017 docs: change license badge style May 10, 2018 当先 -> 当前 Jun 7, 2018
afterbuild.js build: upgrade karma only in CI environment Oct 11, 2017
azure-pipelines.yml Update azure-pipelines.yml for Azure Pipelines Sep 26, 2019
index.js fix:code output Oct 24, 2017
jest.config.js chore: update jest to @23 Sep 25, 2019
karma.conf.js chore: use object.assign for ci testing Sep 26, 2019
lerna.json chore(release): publish v1.5.6 Nov 28, 2019
package-lock.json chore: update jest to @23 Sep 25, 2019
package.json chore: use object.assign for ci testing Sep 26, 2019
release.js chore: better release prompt Mar 4, 2018
tsconfig.json fix: build file include tsd typing Dec 26, 2017
tslint.json chore: remove unsupported rules Mar 26, 2018
typing.js fix: build file include tsd typing Dec 26, 2017
yarn.lock chore(deps): bump is-my-json-valid from 2.16.0 to 2.20.0 (#131) Jun 13, 2019

Build Status License Coverage Status Downloads Build Status Sauce Test Status

Nerv is a virtual-dom based JavaScript (TypeScript) library with identical React 16 API, which offers much higher performance, tinier package size and better browser compatibility.



Identical React API, no 'nerv-compat' is needed

Battle tested, serve in home page and

⚡️ High performance

🤣 IE8 compatibility

🎯 Tiny size, 9Kb gzipped

🌗 Isomorphic rendering on both client and server

💫 Support React 16 features, Error Boundaries, Portals, custom DOM attributes, etc.


This repository is a monorepo that we manage using Lerna. That means that we actually publish several packages to npm from the same codebase, including:

Package Description
nervjs The core of Nerv
nerv-redux Nerv binding for Redux
nerv-devtools Provides support for React's Dev Tools for Nerv
nerv-server Support for server side rendering
nerv-test-utils Suite of utilities for testing Nerv applications
nerv-utils Internal Helpers functions for Nerv
nerv-shared Internal shared functions for Nerv
nerv-create-class The legacy createClass API for Nerv

Getting Started

The easiest way to get started with Nerv is using CodeSandbox Playground, If you use React, you already know how to use Nerv.


Of course we recommend that you use Nerv with Webpack and Babel.First you can install Nerv like this

With npm

$ npm install --save nervjs

With yarn

$ yarn add nervjs


Import what you need. Nerv provides both named and default exports, you can use Nerv as a namespace or simply import what you need as locals.

Default exports:

import Nerv from 'nervjs'
class HelloMessage extends Nerv.Component {
  render() {
    return <div>Hello {}</div>

  <HelloMessage name="Nerv" />,


import { Component, render } from 'nervjs'
class HelloMessage extends Component {
  render() {
    return <div>Hello {}</div>

  <HelloMessage name="Nerv" />,

☝️ For more information please move to the official development document


Switching to Nerv from React

Switching to Nerv from React is easy as adding alias nervjs for react and react-dom. No changes in code needed.

Usage with Webpack

Add an alias in your webpack.config.js:

  // ...
  resolve: {
    alias: {
      'react': 'nervjs',
      'react-dom': 'nervjs',
      // Not necessary unless you consume a module using `createClass`
      'create-react-class': "nerv-create-class"
  // ...

Usage with Babel

Install the babel plugin for aliasing

$ npm install --save-dev babel-plugin-module-resolver

In .babelrc:

  "plugins": [
    ["module-resolver", {
      "root": ["."],
      "alias": {
        "react": "nervjs",
        "react-dom": "nervjs",
        // Not necessary unless you consume a module using `createClass`
        "create-react-class": "nerv-create-class"

Usage with Browserify

Install the aliasify transform:

$ npm i --save-dev aliasify

Then in your package.json:

  "aliasify": {
    "aliases": {
      "react": "nervjs",
      "react-dom": "nervjs"

Compatible with React

Nerv currently support React API and features:


  • React.createClass (legacy)
  • React.createElement
  • React.cloneElement
  • React.Component
  • React.PureComponent
  • React.PropTypes
  • React.Children
  • React.isValidElement
  • React.createFactory
  • Error Boundaries (React 16)


  • React.unstable_renderSubtreeIntoContainer (legacy)
  • ReactDOM.render
  • ReactDOM.unmountComponentAtNode
  • ReactDOM.findDOMNode
  • ReactDOM.hydrate (React 16)
  • ReactDOM.createPortal (React 16)

Internet Explorer 8 (or below) compatibility

First, install es5-polyfill:

npm install --save es5-polyfill

Then insert the code into the beginning of your entry file:


At last, setting .babelrc if you are using babel:

  "presets": [
    ["env", {
      "spec": true,
      "useBuiltIns": false

Developer Tools

Nerv has a development tools module which allows you to inspect the component hierarchies via the React Chrome Developer Tools plugin.

To enable the Nerv development tools you must install the nerv-devtools module and then require('nerv-devtools') before the initial Nerv.render().

if (process.env.NODE_ENV !== 'production')  {
// before Nerv.render()
Nerv.render(<App />, document.getElementById('#root'))


Change Log


AOTU.IO(JD Multi-terminal Development Department)


FOSSA Status

You can’t perform that action at this time.