Hi.
Right now
(process.env.NODE_ENV === 'production' || !Component.propTypes)
from here leads to lack of actual element while testing with Enzyme (NODE_ENV=test) so very dummy stateless components can't be found in a tree. Same problem with react-dev-tools (NODE_ENV=development), I can't see the component because function was directly invoked with props.
I understand the purpose of createEagerFactory, and the idea is really nice, but in my opinion it should be production only optimization. Should we consider removing || !Component.propTypes part from the condition or something like this? It's really confusing and took a lot of time to find the reason.
The same confusion as here let us think a little,
seems like you are right
cc @wuct your thoughts?
The only problem I see is small perf degrade at dev mode.
Also it sounds like a breaking change because it might break many tests based on children count or (which is more likely) Jest snapshots.
The only problem I see is small perf degrade at dev mode.
One can't expect much performance from React in dev mode, all of these warnings, PropTypes, setter guards, and so on :) As for me it's totally fine.
Guys, sorry for pushing, but is there any conclusion? Plans for the next major version?
I remember about this, just took a few weeks break with any computer work. Now Im drinking vodka with bears in deep Russia and have mobile phone only ;-)
You can provide a PR with 90% probability we will accept it
Sorry for late reply and yes, a PR is welcome. This change probably can land at 0.25.
馃惢
Most helpful comment
I remember about this, just took a few weeks break with any computer work. Now Im drinking vodka with bears in deep Russia and have mobile phone only ;-)