React render warning appears when hide method executed
Opened this issue · 7 comments
executing the hide
method produces the following error:
Warning: A component is accessing getDOMNode or findDOMNode inside its render(). render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.
Also seeing this error, we should be able to pass in props to make the modal appear and disappear. Is that possible?
It's because this module uses getDOMNode
in many places https://github.com/yuanyan/boron/search?utf8=%E2%9C%93&q=getdomnode&type=Code @yuanyan a note in the readme justifying it's use should be added.
Well, I'm going to be a bit redundant given the error message already mentioned, but the problem is not that it "uses getDOMNode
in many places". The problem is that it uses that function inside render
.
I'm also seeing this error
Yeah, we're also seeing this warning. Any thoughts on resolution, or whether the warning is something to be concerned about?
Kudos on this work btw!!
+1 getting the warning as well
culprit is line 71 in ModalFactory:
var node = this.refs[ref].getDOMNode();
So there is a real reference to the line in question: https://github.com/yuanyan/boron/blob/master/src/modalFactory.js#L71