React - property key
. Property not found in props #4202
Open
Description
/* @flow */
import React from 'react';
type Props = {
key: string;
foo: number;
}
class Inner extends React.PureComponent {
props: Props;
render() {
return <div>
{this.props.foo}
</div>
}
}
class Outer extends React.PureComponent {
render() {
return <div>
<Inner
key={"some string"}
foo={2}
></Inner>
</div>
}
}
The error:
10: props: Props;
^ property `key`. Property not found in
22: <Inner
^ props of React element `Inner`
Reproducible on flow.org/try .
"Fixed" by removing key: string
from props (flow.org)