* Given a fragment, validate that it can only be provided with fragment props * @param {ReactElement} fragment
(fragment)
| 19560 | * @param {ReactElement} fragment |
| 19561 | */ |
| 19562 | function validateFragmentProps(fragment) { |
| 19563 | currentlyValidatingElement = fragment; |
| 19564 | |
| 19565 | var keys = Object.keys(fragment.props); |
| 19566 | for (var i = 0; i < keys.length; i++) { |
| 19567 | var key = keys[i]; |
| 19568 | if (!VALID_FRAGMENT_PROPS.has(key)) { |
| 19569 | warning(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.%s', key, getStackAddendum()); |
| 19570 | break; |
| 19571 | } |
| 19572 | } |
| 19573 | |
| 19574 | if (fragment.ref !== null) { |
| 19575 | warning(false, 'Invalid attribute `ref` supplied to `React.Fragment`.%s', getStackAddendum()); |
| 19576 | } |
| 19577 | |
| 19578 | currentlyValidatingElement = null; |
| 19579 | } |
| 19580 | |
| 19581 | function createElementWithValidation(type, props, children) { |
| 19582 | var validType = typeof type === 'string' || typeof type === 'function' || |
no test coverage detected