Skip to content
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

Updates for React 0.14 compatibility #4

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions examples/alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import './assets/index.less';
import React from 'react';
import ReactDOM from 'react-dom';
import Animate from 'rc-animate';
var seed = 0;

Expand Down Expand Up @@ -101,7 +102,7 @@ function alert(str, time, type, callback) {
if (!alertGroup) {
var div = document.createElement('div');
document.body.appendChild(div);
alertGroup = React.render(<AlertGroup/>, div);
alertGroup = ReactDOM.render(<AlertGroup/>, div);
}
alertGroup.addAlert({
str: str,
Expand All @@ -121,7 +122,7 @@ function onClick() {
}
}

React.render(<div>
ReactDOM.render(<div>
<h2>notification</h2>
<button onClick={onClick}>show notification</button>
</div>,
Expand Down
3 changes: 2 additions & 1 deletion examples/hide-todo.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import './assets/index.less';
import React from 'react';
import ReactDOM from 'react-dom';
import Animate from 'rc-animate';
import assign from 'object-assign';

Expand Down Expand Up @@ -76,7 +77,7 @@ var TodoList = React.createClass({
}
});

React.render(<div>
ReactDOM.render(<div>
<h2>Hide Todo</h2>
<TodoList />
</div>, document.getElementById('__react-content'));
3 changes: 2 additions & 1 deletion examples/simple-animation.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import './assets/index.less';
import Animate from 'rc-animate';
import React, {Component} from 'react';
import ReactDOM from 'react-dom';
import velocity from 'velocity-animate';

let transitionEnter = true;
Expand Down Expand Up @@ -124,4 +125,4 @@ var Demo = React.createClass({
}
});

React.render(<Demo />, document.getElementById('__react-content'));
ReactDOM.render(<Demo />, document.getElementById('__react-content'));
3 changes: 2 additions & 1 deletion examples/simple-remove.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import './assets/index.less';
import Animate from 'rc-animate';
import React, {Component} from 'react';
import ReactDOM from 'react-dom';

let transitionEnter = true;
let remove = false;
Expand Down Expand Up @@ -44,4 +45,4 @@ class Demo extends Component {
}
}

React.render(<Demo />, document.getElementById('__react-content'));
ReactDOM.render(<Demo />, document.getElementById('__react-content'));
3 changes: 2 additions & 1 deletion examples/simple.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import './assets/slow.less';
import Animate from 'rc-animate';
import React, {Component} from 'react';
import ReactDOM from 'react-dom';

let transitionEnter = true;
let remove = false;
Expand Down Expand Up @@ -48,4 +49,4 @@ class Demo extends Component {
}
}

React.render(<Demo />, document.getElementById('__react-content'));
ReactDOM.render(<Demo />, document.getElementById('__react-content'));
3 changes: 2 additions & 1 deletion examples/todo-animation.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import './assets/index.less';
import React from 'react';
import ReactDOM from 'react-dom';
import Animate from 'rc-animate';
import velocity from 'velocity-animate';

Expand Down Expand Up @@ -123,7 +124,7 @@ var TodoList = React.createClass({
}
});

React.render(<div>
ReactDOM.render(<div>
<h2>Todo</h2>
<TodoList />
</div>, document.getElementById('__react-content'));
3 changes: 2 additions & 1 deletion examples/todo.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import './assets/index.less';
import React from 'react';
import ReactDOM from 'react-dom';
import Animate from 'rc-animate';

var Todo = React.createClass({
Expand Down Expand Up @@ -61,7 +62,7 @@ var TodoList = React.createClass({
}
});

React.render(<div>
ReactDOM.render(<div>
<h2>Todo</h2>
<TodoList />
</div>, document.getElementById('__react-content'));
3 changes: 2 additions & 1 deletion examples/transitionAppear.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import './assets/slow.less';
import Animate from 'rc-animate';
import React, {Component} from 'react';
import ReactDOM from 'react-dom';

const Box = React.createClass({
render(){
Expand Down Expand Up @@ -64,4 +65,4 @@ class Demo extends Component {
}
}

React.render(<Demo />, document.getElementById('__react-content'));
ReactDOM.render(<Demo />, document.getElementById('__react-content'));
3 changes: 2 additions & 1 deletion examples/transitionLeave.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import './assets/index.less';
import Animate from 'rc-animate';
import React, {Component} from 'react';
import ReactDOM from 'react-dom';

let transitionEnter = true;
let remove = false;
Expand Down Expand Up @@ -39,4 +40,4 @@ var Demo = React.createClass({
}
});

React.render(<Demo />, document.getElementById('__react-content'));
ReactDOM.render(<Demo />, document.getElementById('__react-content'));
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rc-animate",
"version": "1.3.0",
"version": "1.4.0",
"description": "css-transition ui component for react",
"keywords": [
"react",
Expand Down Expand Up @@ -43,7 +43,8 @@
"precommit-hook": "1.x",
"rc-server": "3.x",
"rc-tools": "4.x",
"react": "0.13.x",
"react": "0.14.x",
"react-dom": "0.14.x",
"velocity-animate": "~1.2.2"
},
"precommit": [
Expand Down
3 changes: 2 additions & 1 deletion src/AnimateChild.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import ReactDOM from 'react-dom';
import cssAnimate, {isCssAnimationSupported} from 'css-animation';
import animUtil from './util';

Expand All @@ -14,7 +15,7 @@ const AnimateChild = React.createClass({
},

transition(animationType, finishCallback) {
const node = React.findDOMNode(this);
const node = ReactDOM.findDOMNode(this);
const props = this.props;
const transitionName = props.transitionName;
this.stop();
Expand Down