* Given a fragment, validate that it can only be provided with fragment props * @param {ReactElement} fragment
(fragment)
| 18921 | * @param {ReactElement} fragment |
| 18922 | */ |
| 18923 | function validateFragmentProps(fragment) { |
| 18924 | currentlyValidatingElement = fragment; |
| 18925 | |
| 18926 | var keys = Object.keys(fragment.props); |
| 18927 | for (var i = 0; i < keys.length; i++) { |
| 18928 | var key = keys[i]; |
| 18929 | if (!VALID_FRAGMENT_PROPS.has(key)) { |
| 18930 | warning(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.%s', key, getStackAddendum()); |
| 18931 | break; |
| 18932 | } |
| 18933 | } |
| 18934 | |
| 18935 | if (fragment.ref !== null) { |
| 18936 | warning(false, 'Invalid attribute `ref` supplied to `React.Fragment`.%s', getStackAddendum()); |
| 18937 | } |
| 18938 | |
| 18939 | currentlyValidatingElement = null; |
| 18940 | } |
| 18941 | |
| 18942 | function createElementWithValidation(type, props, children) { |
| 18943 | var validType = typeof type === 'string' || typeof type === 'function' || |
no test coverage detected