-
Notifications
You must be signed in to change notification settings - Fork 25k
[TextInput] Add __DEV__ around textInput prop check #8499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- the input component is validating props in production on each render which didn't seem very efficient. This ensures it's only run in development.
|
By analyzing the blame information on this pull request, we identified @JoelMarcey and @Bhullnatik to be potential reviewers. |
|
@facebook-github-bot shipit |
|
Thanks for importing. If you are an FB employee go to Phabricator to review. |
|
Can you change this from an error to a warning? Really don't want different failure modes between dev and prod. |
|
@ide if there's a consensus, I don't mind making another PR! |
|
@ide this seems similar to how we do other propType validation, so I think it's fine. https://github.com/facebook/react/blob/master/src/isomorphic/classic/types/ReactPropTypes.js#L149 |
|
@javache React creates Errors in order to capture the stack trace but it doesn't throw them. It prints a warning during propType validation: https://github.com/facebook/react/blob/95ac239cf3c527b70daeb433b7aeeaf9e41be9e5/src/isomorphic/classic/types/checkReactTypeSpec.js#L84 |
|
@ide so should we change it so that it only prints it instead of throwing? |
|
Yea I think we want to follow what React does with |
- the goal is to have the same failure mode in prod and dev. See conv in facebook#8499
|
@ide dozoisch@534d6ce would that be ok with you? If yes, I'll create a pr. Sorry for not responding, never saw your response 3 days ago! |
- the goal is to have the same failure mode in prod and dev. See conv in facebook#8499
Summary: Follow up of #8499! Open to discussion Motivation: See #8499 (comment) Goal is to have the same failure mode in dev and prod. /cc ide Closes #8757 Differential Revision: D3558991 fbshipit-source-id: c7d133f958e67ab23da486b1ffcb8f9963509b79
Summary: **Motivation** The prop validation was run on every render, even in prod which seems odd to me. This adds a dev check to make sure prod build skips the validation. **Test plan (required)** There are no changes to the ui. Closes facebook#8499 Differential Revision: D3508805 Pulled By: javache fbshipit-source-id: 68c6a1224e33997f9df93481426daff790ef5bcd
Summary: Follow up of facebook#8499! Open to discussion Motivation: See facebook#8499 (comment) Goal is to have the same failure mode in dev and prod. /cc ide Closes facebook#8757 Differential Revision: D3558991 fbshipit-source-id: c7d133f958e67ab23da486b1ffcb8f9963509b79
Summary: **Motivation** The prop validation was run on every render, even in prod which seems odd to me. This adds a dev check to make sure prod build skips the validation. **Test plan (required)** There are no changes to the ui. Closes facebook#8499 Differential Revision: D3508805 Pulled By: javache fbshipit-source-id: 68c6a1224e33997f9df93481426daff790ef5bcd
Summary: Follow up of facebook#8499! Open to discussion Motivation: See facebook#8499 (comment) Goal is to have the same failure mode in dev and prod. /cc ide Closes facebook#8757 Differential Revision: D3558991 fbshipit-source-id: c7d133f958e67ab23da486b1ffcb8f9963509b79
Summary: **Motivation** The prop validation was run on every render, even in prod which seems odd to me. This adds a dev check to make sure prod build skips the validation. **Test plan (required)** There are no changes to the ui. Closes facebook/react-native#8499 Differential Revision: D3508805 Pulled By: javache fbshipit-source-id: 68c6a1224e33997f9df93481426daff790ef5bcd
Summary: Follow up of facebook/react-native#8499! Open to discussion Motivation: See facebook/react-native#8499 (comment) Goal is to have the same failure mode in dev and prod. /cc ide Closes facebook/react-native#8757 Differential Revision: D3558991 fbshipit-source-id: c7d133f958e67ab23da486b1ffcb8f9963509b79
Motivation
The prop validation was run on every render, even in prod which seems odd to me. This adds a dev check to make sure prod build skips the validation.
Test plan (required)
There are no changes to the ui.