Warn about unresolved function as a child#10376
Conversation
| }); | ||
|
|
||
| if (ReactDOMFeatureFlags.useFiber) { | ||
| fdescribe('with new features', () => { |
|
Ran Jest internally with a |
|
|
||
| function warnOnFunctionType() { | ||
| warning( | ||
| false, |
There was a problem hiding this comment.
Why not pass in newChild and put typeof newChild !== 'function' instead of false?
There was a problem hiding this comment.
To avoid two extra functions calls in DEV. (It's small but can add up.)
Also I find our warning notation with falsy condition meaning a failure very confusing. I try to avoid it whenever I write warnings, and always use warning(false so it’s clear from outer condition in which case it executes.
flarnie
left a comment
There was a problem hiding this comment.
I had one question, but I think this makes sense overall. Good tests! :)
|
@gaearon |
…tted by George Speelman
…tted by George Speelman
…tted by George Speelman
…tted by George Speelman
…tted by George Speelman
…tted by George Speelman
…tted by George Speelman
…tted by George Speelman
…tted by George Speelman
…tted by George Speelman
…tted by George Speelman
…tted by George Speelman
…tted by George Speelman
…tted by George Speelman
…tted by George Speelman
…tted by George Speelman
…tted by George Speelman
Fixes #9577.