Closed
Description
Here's a simplified example.
We're using flow, but I guess this will fail when using propTypes
also.
type SomeComponentPropsType = {
onSelectedPlace(query: any, place: any) => void,
};
// This has been simplified.
const onSelectPlace = component => (query, place) => {
component.props.onSelectPlace(query, place);
};
// Changing the above to the following doesn't work either.
const onSelectPlace = ({ props }: { props: SomeComponentPropsType }) => (query, place) => {
props.onSelectPlace(query, place);
}
class SomeComponent extends Component {
props: SomeComponentPropsType;
render() {
return (<button onChange={onSelectPlace(this)}>Select<button>);
}
}