We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
React Ref的发展历程:
facebook/react#1373
The text was updated successfully, but these errors were encountered:
React ref 的前世今生
Sorry, something went wrong.
string ref无法绑定到当前的"所有者":
class Child extends React.Component { componentDidMount() { // `test` ref is here console.log("child", this.refs); } render() { let { renderer } = this.props; return renderer && renderer(); } } class Parent extends React.Component { componentDidMount() { // empty object console.log("parent", this.refs); } render() { return ( <Child renderer={() => { // ref属于调用者`Child`,而不是当前的`Parent` return <input ref="test" placeholder="ref test" />; }} /> ); } }
No branches or pull requests
React Ref的发展历程:
facebook/react#1373
The text was updated successfully, but these errors were encountered: