chore: remove deprecated APIs

This commit is contained in:
Benjy Cui 2015-10-21 17:59:57 +08:00
parent 8c71530838
commit f7a8b11243
9 changed files with 16 additions and 12 deletions

View File

@ -21,7 +21,7 @@
```jsx
import { Datepicker } from 'antd';
React.render(<Datepicker />, mountNode);
ReactDOM.render(<Datepicker />, mountNode);
```
## 链接

View File

@ -17,7 +17,7 @@ An enterprise-class UI design language and React-based implementation.
```jsx
import { Datepicker } from 'antd';
React.render(<Datepicker />, mountNode);
ReactDOM.render(<Datepicker />, mountNode);
```
## Links

View File

@ -1,4 +1,5 @@
import React from 'react';
import ReactDOM from 'react-dom';
import rcUtil from 'rc-util';
function getScroll(w, top) {
@ -52,7 +53,7 @@ let Affix = React.createClass({
handleScroll() {
let affix = this.state.affix;
let scrollTop = getScroll(window, true);
let elemOffset = getOffset(this.getDOMNode());
let elemOffset = getOffset(ReactDOM.findDOMNode(this));
if (!affix && (elemOffset.top - this.props.offset) < scrollTop) {
this.setState({
@ -60,7 +61,7 @@ let Affix = React.createClass({
affixStyle: {
top: this.props.offset,
left: elemOffset.left,
width: this.getDOMNode().offsetWidth
width: ReactDOM.findDOMNode(this).offsetWidth
}
});
}

View File

@ -1,4 +1,5 @@
import React from 'react';
import ReactDOM from 'react-dom';
import Animate from 'rc-animate';
import Icon from '../iconfont';
@ -15,7 +16,7 @@ export default React.createClass({
};
},
handleClose(e) {
let dom = React.findDOMNode(this);
let dom = ReactDOM.findDOMNode(this);
dom.style.height = dom.offsetHeight + 'px';
// Magic code
// height

View File

@ -1,4 +1,5 @@
import React from 'react';
import ReactDOM from 'react-dom';
import Animate from 'rc-animate';
import Icon from '../iconfont';
const prefixCls = 'ant-tag';
@ -14,7 +15,7 @@ class AntTag extends React.Component {
}
close(e) {
let dom = React.findDOMNode(this);
let dom = ReactDOM.findDOMNode(this);
dom.style.width = dom.offsetWidth + 'px';
// It's Magic Code, don't know why
dom.style.width = dom.offsetWidth + 'px';

View File

@ -36,6 +36,7 @@ $ npm install
```jsx
import React from 'react';
import ReactDOM from 'react-dom';
import { Datepicker, message } from 'antd';
var App = React.createClass({
@ -58,7 +59,7 @@ var App = React.createClass({
}
});
React.render(<App />, document.body);
ReactDOM.render(<App />, document.body);
```
> `var Datepicker = require('antd/lib/datepicker')` 单独引入需要的组件文件可以有效减少最终构建文件的大小。

View File

@ -37,7 +37,7 @@
```jsx
import { Datepicker } from 'antd';
React.render(<Datepicker />, mountNode);
ReactDOM.render(<Datepicker />, mountNode);
```
## 版本

View File

@ -189,7 +189,7 @@ let ExtendPalettes = React.createClass({
</div>;
}
});
React.render(<ExtendPalettes />, document.getElementById('extend-palettes'));
ReactDOM.render(<ExtendPalettes />, document.getElementById('extend-palettes'));
`````
## 色彩换算工具
@ -265,5 +265,5 @@ let TintShadeTool = React.createClass({
}
});
React.render(<TintShadeTool />, document.getElementById('color-tint-shade-tool'));
ReactDOM.render(<TintShadeTool />, document.getElementById('color-tint-shade-tool'));
`````

View File

@ -203,7 +203,7 @@ var Test = React.createClass({
},
componentDidMount() {
this.demoNode = React.findDOMNode(this.refs.demo);
this.demoNode = ReactDOM.findDOMNode(this.refs.demo);
},
render() {
@ -225,7 +225,7 @@ var Test = React.createClass({
}
});
React.render(<Test/>, document.getElementById('components-motion-demo-basic'));
ReactDOM.render(<Test/>, document.getElementById('components-motion-demo-basic'));
`````
<style>