* Given a fragment, validate that it can only be provided with fragment props * @param {ReactElement} fragment
(fragment)
| 19698 | * @param {ReactElement} fragment |
| 19699 | */ |
| 19700 | function validateFragmentProps(fragment) { |
| 19701 | currentlyValidatingElement = fragment; |
| 19702 | |
| 19703 | var keys = Object.keys(fragment.props); |
| 19704 | for (var i = 0; i < keys.length; i++) { |
| 19705 | var key = keys[i]; |
| 19706 | if (!VALID_FRAGMENT_PROPS.has(key)) { |
| 19707 | warning(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.%s', key, getStackAddendum()); |
| 19708 | break; |
| 19709 | } |
| 19710 | } |
| 19711 | |
| 19712 | if (fragment.ref !== null) { |
| 19713 | warning(false, 'Invalid attribute `ref` supplied to `React.Fragment`.%s', getStackAddendum()); |
| 19714 | } |
| 19715 | |
| 19716 | currentlyValidatingElement = null; |
| 19717 | } |
| 19718 | |
| 19719 | function createElementWithValidation(type, props, children) { |
| 19720 | var validType = typeof type === 'string' || typeof type === 'function' || |
no test coverage detected