mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 03:59:01 +08:00
chore: remove deprecated APIs
This commit is contained in:
parent
8c71530838
commit
f7a8b11243
@ -21,7 +21,7 @@
|
||||
|
||||
```jsx
|
||||
import { Datepicker } from 'antd';
|
||||
React.render(<Datepicker />, mountNode);
|
||||
ReactDOM.render(<Datepicker />, mountNode);
|
||||
```
|
||||
|
||||
## 链接
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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';
|
||||
|
@ -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')` 单独引入需要的组件文件可以有效减少最终构建文件的大小。
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
```jsx
|
||||
import { Datepicker } from 'antd';
|
||||
React.render(<Datepicker />, mountNode);
|
||||
ReactDOM.render(<Datepicker />, mountNode);
|
||||
```
|
||||
|
||||
## 版本
|
||||
|
@ -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'));
|
||||
`````
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user