Created
January 8, 2019 03:17
-
-
Save ajcrites/0f5a0461111a08b978a8ae9dacdad696 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class About extends React.Component { | |
contentRef = React.createRef(); | |
async animate(show) { | |
... | |
this.setState({ show }); | |
} | |
render() { | |
return this.state.show ? | |
<AboutContent ref={this.contentRef} /> : | |
null; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const About = () => { | |
const contentRef = useRef(null); | |
const [show, setShow] = useState(false); | |
const animate = async show => { | |
... | |
setShow(show); | |
} | |
return show ? <AboutContent ref={contentRef} /> : null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment