Skip to content

Working with React 15.x #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
2 changes: 1 addition & 1 deletion src/Async.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

import React from 'react';
import invariant from 'react/lib/invariant';
import invariant from 'invariant';
import AsyncComponent from './AsyncComponent';

/**
Expand Down
6 changes: 3 additions & 3 deletions src/AsyncComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 5 additions & 4 deletions src/__tests__/Async-browser-test.js
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -34,17 +35,17 @@ 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) {
return TestUtils.renderIntoDocument(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() {
Expand Down
2 changes: 1 addition & 1 deletion src/index.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions src/renderToString.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down