Skip to content

Conversation

@Gregoirevda
Copy link
Contributor

As far as I know, only React global has createElement property. So, if this check is made: https://github.com/facebook/react/blob/master/packages/react/src/React.js#L43 there shouldn't be any __DEV__ checks in the 'non validation' file?

Before submitting a pull request, please make sure the following is done:

  1. Fork the repository and create your branch from master.
  2. Run yarn in the repository root.
  3. If you've fixed a bug or added code that should be tested, add tests!
  4. Ensure the test suite passes (yarn test). Tip: yarn test --watch TestName is helpful in development.
  5. Run yarn test-prod to test in the production environment. It supports the same options as yarn test.
  6. Format your code with prettier (yarn prettier).
  7. Make sure your code lints (yarn lint). Tip: yarn linc to only check changed files.
  8. Run the Flow typechecks (yarn flow).
  9. If you haven't already, complete the CLA.

Learn more about contributing: https://reactjs.org/docs/how-to-contribute.html

As far as I know, only `React` global has `createElement` property. So, if this check is made: https://github.com/facebook/react/blob/master/packages/react/src/React.js#L43 there shouldn't be any `__DEV__` checks in the 'non validation' file?
@jquense
Copy link
Contributor

jquense commented Dec 4, 2017

Hey there. So all validations are removed in the production copy via dead code elimination, so there is no worry about warnings slipping into the prod build. This change however, will remove those warnings for both dev and prod builds which is not what we want. Notice that ReactElementValidator imports ReactElement, so the warnings are added on top of what's already in ReactElement

@jquense jquense closed this Dec 4, 2017
@Gregoirevda
Copy link
Contributor Author

Oh ok! It's not ReactElementValidator or ReactElement, but more ReactElementValidator that is an extension of ReactElement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants