Skip to content
This repository was archived by the owner on Sep 10, 2022. It is now read-only.
This repository was archived by the owner on Sep 10, 2022. It is now read-only.

should isReferentiallyTransparentFunctionComponent be completely off for non-production env? #442

@deepsweet

Description

@deepsweet

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions