I'm seeing what I believe to be unexpected pass-cases and, in general, inconsistent behavior with underconstrained component props. I've boiled down the example to something simple enough to illustrate the problem but still gets to the brunt of my real-world use-case.
The general premise is being able to have:
a union of types (with type and state fields)
a component that will take in the common type field as well as take in a component that should expect the corresponding state
In general, I've gotten Flow to handle this well (albeit inconsistently) until I start nesting the component in something else (even just a <div/>)
Looking at the TryFlow link below, Flow handles this situation well except in the last cases, which I'm not sure why. This feels like a bug, but maybe I'm missing something.
I'm seeing what I believe to be unexpected pass-cases and, in general, inconsistent behavior with underconstrained component props. I've boiled down the example to something simple enough to illustrate the problem but still gets to the brunt of my real-world use-case.
The general premise is being able to have:
type
andstate
fields)type
field as well as take in a component that should expect the correspondingstate
In general, I've gotten Flow to handle this well (albeit inconsistently) until I start nesting the component in something else (even just a
<div/>
)Example:
Looking at the TryFlow link below, Flow handles this situation well except in the last cases, which I'm not sure why. This feels like a bug, but maybe I'm missing something.
Try Flow