Closed bpetetot closed 3 years ago
The difference will be that the component will be rendered twice insteaf of once (the HoC). Do you agree?
That being said I don't think this is a big performance issue since the wrapped component is not rendered, and I don't know if we will see clipping.
Did you test this modification locally?
Too old I close it ;)
With new version of react
componentWillMount
is deprecated, and will be removed in the next major version. So I changed it by thecomponentDidMount
which seems correct because component will be mounted but not displayed by default (with stateshow=false
), then once mounted it will the correct test.It avoids lot of annoying messages in the console in dev mode. Here in the conference hall project:
If you dont agree to replace it by
componentDidMount
, we can simply replace it byUNSAFE_componentWillMount
. But it wont be future proof.