diff --git a/package.json b/package.json index 97e3b28..37cbf92 100644 --- a/package.json +++ b/package.json @@ -8,24 +8,28 @@ "./src/index.js": "./src/index.web.js" }, "dependencies": { - "ascii-json": "~0.2.0" + "ascii-json": "~0.2.0", + "exenv": "^1.2.1", + "fibers": "^1.0.13", + "invariant": "^2.2.1" }, "peerDependencies": { - "react": "^0.13.0" + "react": "^15.3.1", + "react-dom": "^15.3.1" }, "devDependencies": { - "axios": "^0.5.2", - "babel": "^5.0.8", - "babelify": "^6.0.1", - "bluebird": "^2.9.24", - "browserify": "^6.1.0", - "connect-browserify": "~3.2.1", - "express": "~4.9.8", - "fibers": "~1.0.1", + "axios": "^0.5.4", + "babel": "^5.8.38", + "babelify": "^6.4.0", + "bluebird": "^2.10.2", + "browserify": "^6.3.4", + "connect-browserify": "^3.2.1", + "express": "^4.9.8", "mocha": "~1.21.5", "mochify": "^1.4.0", "phantomjs": "^1.9.11", - "react": "^0.13.0", + "react": "^15.3.1", + "react-dom": "^15.3.1", "rx": "^2.5.1", "semver": "~4.1.0" }, diff --git a/src/Async.js b/src/Async.js index ac1ab96..53e0b4d 100644 --- a/src/Async.js +++ b/src/Async.js @@ -3,7 +3,7 @@ */ import React from 'react'; -import invariant from 'react/lib/invariant'; +import invariant from 'invariant'; import AsyncComponent from './AsyncComponent'; /** diff --git a/src/AsyncComponent.js b/src/AsyncComponent.js index f49e9f6..676cb8c 100644 --- a/src/AsyncComponent.js +++ b/src/AsyncComponent.js @@ -3,9 +3,9 @@ */ import React from 'react'; -import ExecutionEnvironment from 'react/lib/ExecutionEnvironment'; -import invariant from 'react/lib/invariant'; -import emptyFunction from 'react/lib/emptyFunction'; +import ExecutionEnvironment from 'exenv'; +import invariant from 'invariant'; +import emptyFunction from 'fbjs/lib/emptyFunction'; let Fiber; let Future; diff --git a/src/__tests__/Async-browser-test.js b/src/__tests__/Async-browser-test.js index 2bcab8a..ce880f3 100644 --- a/src/__tests__/Async-browser-test.js +++ b/src/__tests__/Async-browser-test.js @@ -1,5 +1,6 @@ import assert from 'assert'; import React from 'react'; +import ReactDOM from 'react-dom'; import TestUtils from 'react/lib/ReactTestUtils'; import Async from '../Async'; @@ -34,8 +35,8 @@ function start() { } function rerender(component, element) { - let container = React.findDOMNode(component).parentNode; - React.render(element, container); + let container = ReactDOM.findDOMNode(component).parentNode; + ReactDOM.render(element, container); } function render(element) { @@ -43,8 +44,8 @@ function render(element) { } function unmount(component) { - let container = React.findDOMNode(component).parentNode; - React.unmountComponentAtNode(container); + let container = ReactDOM.findDOMNode(component).parentNode; + ReactDOM.unmountComponentAtNode(container); } describe('AsyncComponent (browser)', function() { diff --git a/src/index.web.js b/src/index.web.js index a52a6cc..6c43ecf 100644 --- a/src/index.web.js +++ b/src/index.web.js @@ -2,7 +2,7 @@ * @copyright 2015 Andrey Popp <8mayday@gmail.com> */ -import invariant from 'react/lib/invariant'; +import invariant from 'invariant'; import Async from './Async'; export default Async; diff --git a/src/renderToString.js b/src/renderToString.js index 4a281bf..300815e 100644 --- a/src/renderToString.js +++ b/src/renderToString.js @@ -3,7 +3,8 @@ */ import React from 'react'; -import invariant from 'react/lib/invariant'; +import ReactDOM from 'react-dom/server'; +import invariant from 'invariant'; import injectIntoMarkup from './injectIntoMarkup'; let Fiber; @@ -31,7 +32,7 @@ export default function renderToString(element, cb) { Fiber.current.__reactAsyncDataPacket__ = {}; let data = Fiber.current.__reactAsyncDataPacket__; - let markup = React.renderToString(element); + let markup = ReactDOM.renderToString(element); // Inject data if callback doesn't receive the data argument if (cb.length === 2) {