101
rated 0 times
[
108]
[
7]
/ answers: 1 / hits: 17164
/ 7 Years ago, tue, december 19, 2017, 12:00:00
I have a react component which take a dom reference when mounting (I know this is an edge case). I would like to know if it is necessary set to null
the property which host the dom. Or does react take care of it?
componentDidMount() {
this.elm = document.getElementById('foo')
}
componentWillUnmount(){
this.elm = null
}
More From » reactjs