We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4efdaa9 commit ac00d0dCopy full SHA for ac00d0d
src/copy-to-clipboard/README.md
@@ -55,7 +55,8 @@ class Demo extends React.Component {
55
super(props);
56
this.state = {
57
copyText: "生亦何欢,死亦何苦"
58
- }
+ };
59
+ this.input = React.createRef();
60
}
61
onChange(e){
62
this.setState({
@@ -69,7 +70,7 @@ class Demo extends React.Component {
69
70
<div>
71
<Input
72
type="text"
- ref={(input) => this.input = input}
73
+ ref={this.input}
74
value={copyText}
75
onChange={this.onChange.bind(this)}
76
/>
@@ -84,7 +85,7 @@ class Demo extends React.Component {
84
85
this.setState({ message: '' });
86
}, 2000);
87
});
- ReactDOM.findDOMNode(this.input).querySelector('input').select();
88
+ this.input.current.inputRef.current.select();
89
}}
90
>
91
<Button type="primary">点击复制</Button>
0 commit comments