dillon1000/react

Commit

Add React.isValidElementType() (#12483)

* Add React.isValidElementType()

Per the conversation on #12453, there are a number of third-party
libraries (particularly those that generate higher-order components)
that are performing suboptimal validation of element types.

This commit exposes a function that can perform the desired check
without depending upon React internals.

* Move isValidElementType to shared/
Browse files
Changed paths4 files
First-parent comparison
M packages/react-is/src/ReactIs.js ModifiedM packages/react-is/src/__tests__/ReactIs-test.js ModifiedM packages/react/src/ReactElementValidator.js ModifiedA packages/shared/isValidElementType.js Added
Patch

Files changed

Rendering syntax-highlighted changes…