Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React, { PureComponent } from 'react';
- class MyComponent extends PureComponent {
- constructor(props) {
- super(props);
- this.myRef = React.createRef();
- }
- componentDidMount() {
- console.log(this.myRef);
- }
- render() {
- return (
- <div className="test" ref={this.myRef} />
- );
- }
- }
- {current: null}
Add Comment
Please, Sign In to add comment