Closed okonet closed 7 years ago
Please see the discussion in #125, do you get an error or just no validation?
You will get a prop validation error because children is not an instance of a React.Component, but is instead a ReactElement. Those don't have a prototype though, so you will have to define a custom type or use Object.
@ntkoopman how to define a custom type for it? Any examples?
@okonet you can create a simplified copy of the definition at https://github.com/facebook/flow/blob/master/lib/react.js#L111
e.g.
type React$Element = {
type: Function;
props: Object;
key: ?string;
ref: any;
};
Hi, sorry for taking so long to respond to this, this project is now deprecated in favour of https://codemix.github.io/flow-runtime which aims for full compatibility with Flow.
babel-plugin-flow-runtime
and flow-runtime
have full support for React.
I think this was working in
3.6.1
but it isn't anymore in3.8.0