* Given a fragment, validate that it can only be provided with fragment props * @param {ReactElement} fragment
(fragment)
| 18793 | * @param {ReactElement} fragment |
| 18794 | */ |
| 18795 | function validateFragmentProps(fragment) { |
| 18796 | currentlyValidatingElement = fragment; |
| 18797 | |
| 18798 | var keys = Object.keys(fragment.props); |
| 18799 | for (var i = 0; i < keys.length; i++) { |
| 18800 | var key = keys[i]; |
| 18801 | if (!VALID_FRAGMENT_PROPS.has(key)) { |
| 18802 | warning(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.%s', key, getStackAddendum()); |
| 18803 | break; |
| 18804 | } |
| 18805 | } |
| 18806 | |
| 18807 | if (fragment.ref !== null) { |
| 18808 | warning(false, 'Invalid attribute `ref` supplied to `React.Fragment`.%s', getStackAddendum()); |
| 18809 | } |
| 18810 | |
| 18811 | currentlyValidatingElement = null; |
| 18812 | } |
| 18813 | |
| 18814 | function createElementWithValidation(type, props, children) { |
| 18815 | var validType = typeof type === 'string' || typeof type === 'function' || |
no test coverage detected