node package manager


Require this to get a single instance of React in Atom. Addons are lazily loaded.


Build Status

Singleton lazy loading wrapper around facebook/react.

A single instance of React

React does not currently co-exist well with other instances of React in the same environment (see #3252, #2402).

We propose that Atom package developers wanting to use React require this package instead of other variants of React. react-for-atom exports React, ReactDOM, and all of React's addons.

Using CommonJS

const {
} = require('react-for-atom');
// optional 
const {PropTypes} = React;

Using (babel transpiled) ES Modules

// React is the default export 
import React, {
  // addons... 
} from 'react-for-atom';
// Or, it's also available as a named export 
import {
  // addons... 
} from 'react-for-atom';

We plan to closely track the React release cycle in order to be able to use the latest features as well as provide access to React API warnings (in atom --dev mode).

Lazy loading

Only when a property is looked up on the react-for-atom export is that module actually require'd.

const ReactForAtom = require('react-for-atom');
// `react` is actually required here 
const {React} = ReactForAtom;
// `TestUtils` is actually required here 
const {TestUtils} = ReactForAtom;


Prior to 0.14.6, react-for-atom version numbers were loosely related to the React version in dependencies. From that version onward, the version of react-for-atom matches the React version.

Changes to react-for-atom are reflected in pre-release versions (e.g. 0.14.6-1). From a semver perspective, this doesn't make sense. However, because you should pin the version of react-for-atom anyway, this is a clear workaround for conveying React versioning info.