问题
Having changed the implementation of a function added to the DispatchProps of a component using react-redux I got the following error:
yarn run v1.13.0
$ flow
Cannot call this.props.<prop> because:
• Either property <prop> is missing in ExternalProps [1].
• Or property <prop> is missing in ConnectProps [2].
However, the prop was part of the DispatchProps; which is intersected with the mentioned props: type Props = ExternalProps & ConnectProps & DispatchProps.
回答1:
The issue was apparently a type-error in the implementation of the function. This seems to lead to flow not adding the function to the props and then complaining in this way - refactoring the function to use types at a more granular level had flow reporting the issue correctly.
来源:https://stackoverflow.com/questions/54644817/missleading-flow-type-error-in-react-props