【发布时间】:2023-09-13 13:24:01
【问题描述】:
我正在尝试将 withNavigationFocus 用于组件,因为代码是用 Typescript 编写的。 ,
我的组件道具
interface IScreenProps {
navigation: NavigationScreenProp<NavigationState, IParamsNavigate>;
departments: NavigationNode[] | null;
updateSearchCriteria: (searchCriteria: ISearchCriteria, stack: StackNames) => void;
resetProductState: () => void;
isFocused: boolean;
}
组件
class SearchScreen extends React.Component<IScreenProps, IScreenState> {
.....
}
export default connect(mapStateToProps, mapDispatchToProps)( withNavigationFocus(SearchScreen));
没有构建错误,在 searchScreen 导出的编辑器/IDE 中仍然显示红线。 .我在下面附上了我面临的错误。
请告诉我如何解决这个问题。
【问题讨论】:
标签: typescript react-native ecmascript-6 types react-navigation