refs

1.回调函数模式,动态设置refs

2.React will call the ref callback with the DOM element when the component mounts, and call it with null when it unmounts. ref callbacks are invoked before componentDidMount or componentDidUpdate lifecycle hooks.

https://reactjs.org/docs/refs-and-the-dom.html

猜你喜欢

转载自luqingxuan.iteye.com/blog/2405064