Guest User

Untitled

a guest
Aug 16th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. import React, { PureComponent } from 'react';
  2.  
  3. class MyComponent extends PureComponent {
  4. constructor(props) {
  5. super(props);
  6. this.myRef = React.createRef();
  7. }
  8.  
  9. componentDidMount() {
  10. console.log(this.myRef);
  11. }
  12.  
  13. render() {
  14. return (
  15. <div className="test" ref={this.myRef} />
  16. );
  17. }
  18. }
  19.  
  20. {current: null}
Add Comment
Please, Sign In to add comment