* Given a fragment, validate that it can only be provided with fragment props * @param {ReactElement} fragment
(fragment)
| 20904 | * @param {ReactElement} fragment |
| 20905 | */ |
| 20906 | function validateFragmentProps(fragment) { |
| 20907 | currentlyValidatingElement = fragment; |
| 20908 | |
| 20909 | var keys = Object.keys(fragment.props); |
| 20910 | for (var i = 0; i < keys.length; i++) { |
| 20911 | var key = keys[i]; |
| 20912 | if (!VALID_FRAGMENT_PROPS.has(key)) { |
| 20913 | warning(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.%s', key, getStackAddendum()); |
| 20914 | break; |
| 20915 | } |
| 20916 | } |
| 20917 | |
| 20918 | if (fragment.ref !== null) { |
| 20919 | warning(false, 'Invalid attribute `ref` supplied to `React.Fragment`.%s', getStackAddendum()); |
| 20920 | } |
| 20921 | |
| 20922 | currentlyValidatingElement = null; |
| 20923 | } |
| 20924 | |
| 20925 | function createElementWithValidation(type, props, children) { |
| 20926 | var validType = typeof type === 'string' || typeof type === 'function' || |
no test coverage detected