-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
Description
SyntheticEvents appear to not be included in 55, but works in 54.1 and lower
Test code (linked above):
import * as React from 'react';
type Props = {
onChange?: (value: ?string) => void
};
class MyComponent extends React.Component<Props> {
handleClick = (e: SyntheticEvent<>) => {
const {onChange} = this.props
if (onChange) {
onChange('foo clicked')
}
}
render() {
return <div onClick={this.handleClick}>foo</div>;
}
}
<MyComponent />;8: handleClick = (e: SyntheticEvent<>) => {
^ identifier `SyntheticEvent`. Could not resolve name
This seems like a regression, because these SyntheticEvents are still in the libdef https://github.com/facebook/flow/blob/v0.55.0/lib/react-dom.js
and recommended to be used by https://flow.org/en/docs/react/events/
Here is an exact 55 try flow of the docs example, which also works in 54.1 and lower.
I actually came to report a different issue and when trying to boil down the test case, perhaps this is the root cause.
Reactions are currently unavailable