boron icon indicating copy to clipboard operation
boron copied to clipboard

React render warning appears when hide method executed

Open rawgroundbeef opened this issue 10 years ago • 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.

rawgroundbeef avatar Jun 21 '15 02:06 rawgroundbeef

Also seeing this error, we should be able to pass in props to make the modal appear and disappear. Is that possible?

briandipalma avatar Jul 05 '15 15:07 briandipalma

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.

morenoh149 avatar Jul 29 '15 05:07 morenoh149

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.

g-p-g avatar Jul 29 '15 14:07 g-p-g

I'm also seeing this error

interator avatar Aug 12 '15 09:08 interator

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!!

musbaig avatar Sep 03 '15 20:09 musbaig

+1 getting the warning as well culprit is line 71 in ModalFactory: var node = this.refs[ref].getDOMNode();

idokleinman avatar Oct 20 '15 01:10 idokleinman

So there is a real reference to the line in question: https://github.com/yuanyan/boron/blob/master/src/modalFactory.js#L71

remotezygote avatar Nov 04 '15 22:11 remotezygote