The type of ReactFragment currently includes {}, which causes the new, safer handling of typeof x === 'function' to only narrow x to Function.
Sample playground link
This same code would work as intended in TS 3.0.
I don't know why an empty object is considered a valid fragment; this allows literally anything to be passed as a child as long as it's not "fresh".
@types/xxxxpackage and had problems.Definitions by:inindex.d.ts) so they can respond.index.d.ts)The type of
ReactFragmentcurrently includes{}, which causes the new, safer handling oftypeof x === 'function'to only narrowxtoFunction.Sample playground link
This same code would work as intended in TS 3.0.
I don't know why an empty object is considered a valid fragment; this allows literally
anything to be passed as a child as long as it's not "fresh".