( value: mixed, propName: string, )
| 102 | } |
| 103 | |
| 104 | export function checkPropStringCoercion( |
| 105 | value: mixed, |
| 106 | propName: string, |
| 107 | ): void | string { |
| 108 | if (__DEV__) { |
| 109 | if (willCoercionThrow(value)) { |
| 110 | console.error( |
| 111 | 'The provided `%s` prop is an unsupported type %s.' + |
| 112 | ' This value must be coerced to a string before using it here.', |
| 113 | propName, |
| 114 | typeName(value), |
| 115 | ); |
| 116 | return testStringCoercion(value); // throw (to help callers find troubleshooting comments) |
| 117 | } |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | export function checkOptionStringCoercion( |
| 122 | value: mixed, |
no test coverage detected