dillon1000/react

Commit

Warn if PropType function is called manually (#7132)

* Warn if PropType function is called in production

* Check if console is undefined before warning

* Randomize value of ReactPropTypesSecret

* Remove dev environment tests

* Rename typeCheckPass to productionWarningCheck

* Rename productionWarningCheck to expectWarningInProduction

* Call toString on Math.random()

* Rename test block for React type checks

* Make sure warning isnt emitted for failing props

* Cache warning by component and prop, warn in dev

* Pass ReactPropTypesSecret to internal checks

* Move tests to ReactPropTypes-test.js

* Update the warning message to include link

* Do not test warning for unions  with invalid args
Browse files
Changed paths6 files
First-parent comparison
M src/addons/link/__tests__/ReactLinkPropTypes-test.js ModifiedM src/isomorphic/classic/types/ReactPropTypes.js ModifiedA src/isomorphic/classic/types/ReactPropTypesSecret.js AddedM src/isomorphic/classic/types/__tests__/ReactPropTypes-test.js ModifiedM src/isomorphic/classic/types/checkReactTypeSpec.js ModifiedM src/renderers/dom/client/wrappers/LinkedValueUtils.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…