Description
Flow version: 0.104
Expected behavior
Don't error when the intersection can be rendered as a React component.
Alternatively, if this is another strange design decision regarding React.AbstractComponent
, can we at least error early (as soon as we try to intersect with AbstractComponent
) instead of in a random place in the code.
Actual behavior
Flow complains that React.Component
is not a React component when it appears in an intersection with AbstractComponent
.
However, a real-world example of this can be found in flow-typed's typedefs for styled-components: https://github.com/flow-typed/flow-typed/pull/3517/files#diff-2b77bbf95ac6caa4414db8ad19a62162 (search for should render as the correct element
for the whole test that reproduces this, and for noExpectError
for the immediate line below it that triggers the error).
More information about it can be found in flow-typed/flow-typed#3517 (comment) (and some subsequent comments).
/cc @goodmind