Skip to content

Commit

Permalink
Support 0.14 (remove deprecated feature warnings).
Browse files Browse the repository at this point in the history
  • Loading branch information
pieterv committed Oct 26, 2015
1 parent cf28c0e commit c72d60b
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 13 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Add the default stylesheet `dist/fixed-data-table.css`, then require it into any

```javascript
var React = require('react');
var ReactDOM = require('react-dom');
var FixedDataTable = require('fixed-data-table');

var Table = FixedDataTable.Table;
Expand All @@ -51,7 +52,7 @@ function rowGetter(rowIndex) {
return rows[rowIndex];
}

React.render(
ReactDOM.render(
<Table
rowHeight={50}
rowGetter={rowGetter}
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "A React table component designed to allow presenting thousands of rows of data.",
"main": "main.js",
"peerDependencies": {
"react": ">=0.13.0 <0.15.0 || ^0.14.0-beta3"
"react": ">=0.13.0 <0.15.0 || ^0.14.0-beta3",
"react-dom": ">=0.14.0 <0.15.0 || ^0.14.0-beta3"
},
"devDependencies": {
"autoprefixer": "^5.0.0",
Expand All @@ -23,7 +24,7 @@
"null-loader": "^0.1.0",
"postcss": "^4.0.2",
"postcss-custom-properties": "3.0.1",
"react": "^0.13.0",
"react": "^0.14.0",
"react-docgen": "^1.2.0",
"react-tools": "^0.12.2",
"style-loader": "^0.8.3",
Expand Down
3 changes: 2 additions & 1 deletion site/IndexPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var ColumnAPIPage = require('./docs/ColumnAPIPage');
var ColumnGroupAPIPage = require('./docs/ColumnGroupAPIPage');
var ExamplesPage = require('./examples/ExamplesPage');
var React = require('react');
var ReactDOMServer = require('react-dom/server');

var faviconURL = require('./images/favicon.png');

Expand All @@ -25,7 +26,7 @@ var IndexPage = React.createClass({

renderToString(props) {
return IndexPage.getDoctype() +
React.renderToString(<IndexPage {...props} />);
ReactDOMServer.renderToString(<IndexPage {...props} />);
},
},

Expand Down
3 changes: 2 additions & 1 deletion site/client.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"use strict";

var React = require('react');
var ReactDOM = require('react-dom');
var IndexPage = require('./IndexPage');

React.render(
ReactDOM.render(
<IndexPage
{...window.INITIAL_PROPS}
/>,
Expand Down
4 changes: 1 addition & 3 deletions site/examples/TouchExampleWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ var TouchableArea = require('./TouchableArea');

var PropTypes = React.PropTypes;

var cloneWithProps = require('react/lib/cloneWithProps');

function isTouchDevice() {
return 'ontouchstart' in document.documentElement // works on most browsers
|| 'onmsgesturechange' in window; // works on ie10
Expand All @@ -46,7 +44,7 @@ var ExampleTouchWrapper = React.createClass({

render() {
if (!isTouchDevice()) {
return cloneWithProps(this.props.children, {
return React.cloneElement(this.props.children, {
tableHeight: this.props.tableHeight,
tableWidth: this.props.tableWidth,
});
Expand Down
5 changes: 3 additions & 2 deletions site/home/Header.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"use strict";

var React = require('react');
var ReactDOM = require('react-dom');
var Constants = require('../Constants');

var FIXED_THRESHOLD = 680;
Expand All @@ -22,7 +23,7 @@ var Header = React.createClass({

componentDidMount() {
this.offsetWidth = this._getWindowWidth();
this.offsetHeight = this.getDOMNode().offsetHeight;
this.offsetHeight = ReactDOM.findDOMNode(this).offsetHeight;
window.addEventListener('scroll', this.handleScroll);
window.addEventListener('resize', this.handleResize);

Expand All @@ -39,7 +40,7 @@ var Header = React.createClass({

handleResize(event) {
this.offsetWidth = this._getWindowWidth();
this.offsetHeight = this.getDOMNode().offsetHeight;
this.offsetHeight = ReactDOM.findDOMNode(this).offsetHeight;
this.setState({
fixed: this.offsetWidth <= FIXED_THRESHOLD,
});
Expand Down
7 changes: 4 additions & 3 deletions src/Scrollbar.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
var DOMMouseMoveTracker = require('DOMMouseMoveTracker');
var Keys = require('Keys');
var React = require('React');
var ReactDOM = require('ReactDOM');
var ReactComponentWithPureRenderMixin = require('ReactComponentWithPureRenderMixin');
var ReactWheelHandler = require('ReactWheelHandler');

Expand Down Expand Up @@ -318,7 +319,7 @@ var Scrollbar = React.createClass({
_onMouseDown(/*object*/ event) {
var nextState;

if (event.target !== React.findDOMNode(this.refs.face)) {
if (event.target !== ReactDOM.findDOMNode(this.refs.face)) {
// Both `offsetX` and `layerX` are non-standard DOM property but they are
// magically available for browsers somehow.
var nativeEvent = event.nativeEvent;
Expand All @@ -345,7 +346,7 @@ var Scrollbar = React.createClass({

this._mouseMoveTracker.captureMouseMoves(event);
// Focus the node so it may receive keyboard event.
React.findDOMNode(this).focus();
ReactDOM.findDOMNode(this).focus();
},

_onMouseMove(/*number*/ deltaX, /*number*/ deltaY) {
Expand Down Expand Up @@ -467,7 +468,7 @@ var Scrollbar = React.createClass({
if (this.isMounted()) {
try {
this._onBlur();
React.findDOMNode(this).blur();
ReactDOM.findDOMNode(this).blur();
} catch (oops) {
// pass
}
Expand Down
12 changes: 12 additions & 0 deletions src/stubs/react/ReactDOM.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Copyright (c) 2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule ReactDOM
*/

module.exports = require('react-dom');
6 changes: 6 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ module.exports = {
commonjs2: 'react',
amd: 'react',
},
'react-dom': {
root: 'ReactDOM',
commonjs: 'react-dom',
commonjs2: 'react-dom',
amd: 'react-dom',
},
},

node: {
Expand Down

0 comments on commit c72d60b

Please sign in to comment.