Skip to content

Commit b668430

Browse files
author
Evgueni Naverniouk
committed
Adds support for React 15 and upgrades current website to React 15 RC2.
1 parent 0f1b5d8 commit b668430

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

examples/01 Dustbin/Single Target/__tests__/Box-test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('Box', () => {
1919
isDragging={false} />
2020
);
2121
let div = TestUtils.findRenderedDOMComponentWithTag(root, 'div');
22-
expect(div.props.style.opacity).toEqual(1);
22+
expect(div.style.opacity).toEqual('1');
2323

2424
// Render with another set of props and test
2525
root = TestUtils.renderIntoDocument(
@@ -28,7 +28,7 @@ describe('Box', () => {
2828
isDragging />
2929
);
3030
div = TestUtils.findRenderedDOMComponentWithTag(root, 'div');
31-
expect(div.props.style.opacity).toEqual(0.4);
31+
expect(div.style.opacity).toEqual('0.4');
3232
});
3333

3434
it('can be tested with the testing backend', () => {
@@ -41,14 +41,14 @@ describe('Box', () => {
4141

4242
// Check that the opacity is 1
4343
let div = TestUtils.findRenderedDOMComponentWithTag(root, 'div');
44-
expect(div.props.style.opacity).toEqual(1);
44+
expect(div.style.opacity).toEqual('1');
4545

4646
// Find the drag source ID and use it to simulate the dragging state
4747
const box = TestUtils.findRenderedComponentWithType(root, Box);
4848
backend.simulateBeginDrag([box.getHandlerId()]);
4949

5050
// Verify that the div changed its opacity
5151
div = TestUtils.findRenderedDOMComponentWithTag(root, 'div');
52-
expect(div.props.style.opacity).toEqual(0.4);
52+
expect(div.style.opacity).toEqual('0.4');
5353
});
54-
});
54+
});

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"lodash": "^4.2.0"
4545
},
4646
"peerDependencies": {
47-
"react": "^0.14.0"
47+
"react": "^0.14.0 || ^15.0.0-0"
4848
},
4949
"devDependencies": {
5050
"animation-frame": "^0.2.4",
@@ -75,10 +75,10 @@
7575
"mocha": "^2.2.5",
7676
"null-loader": "^0.1.0",
7777
"postcss": "^4.0.2",
78-
"react": "^0.14.0",
78+
"react": "^15.0.0-rc.2",
7979
"react-dnd-html5-backend": "^2.1.2",
8080
"react-dnd-test-backend": "^1.0.2",
81-
"react-dom": "^0.14.0",
81+
"react-dom": "^15.0.0-rc.2",
8282
"react-hot-loader": "^1.2.3",
8383
"react-router": "~0.13.2",
8484
"request": "2.46.0",

site/IndexPage.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import HomePage from './pages/HomePage';
44
import APIPage from './pages/APIPage';
55
import ExamplePage from './pages/ExamplePage';
66
import React, { Component } from 'react';
7+
import ReactDOMServer from 'react-dom/server';
78

89
const APIDocs = {
910
OVERVIEW: require('../docs/00 Quick Start/Overview.md'),
@@ -47,7 +48,7 @@ export default class IndexPage extends Component {
4748

4849
static renderToString(props) {
4950
return IndexPage.getDoctype() +
50-
React.renderToString(<IndexPage {...props} />);
51+
ReactDOMServer.renderToString(<IndexPage {...props} />);
5152
}
5253

5354
constructor(props) {
@@ -138,4 +139,4 @@ export default class IndexPage extends Component {
138139
});
139140
}
140141
}
141-
}
142+
}

0 commit comments

Comments
 (0)