Typescript withNavigationFocus抛出lint错误-反应本机类型脚本
我正在尝试将withNavigationFocus用于组件,因为代码是用Typescript编写的 我的组件道具Typescript withNavigationFocus抛出lint错误-反应本机类型脚本,typescript,react-native,ecmascript-6,types,react-navigation,Typescript,React Native,Ecmascript 6,Types,React Navigation,我正在尝试将withNavigationFocus用于组件,因为代码是用Typescript编写的 我的组件道具 interface IScreenProps { navigation: NavigationScreenProp<NavigationState, IParamsNavigate>; departments: NavigationNode[] | null; updateSearchCriteria: (searchCriteria: ISearchC
interface IScreenProps {
navigation: NavigationScreenProp<NavigationState, IParamsNavigate>;
departments: NavigationNode[] | null;
updateSearchCriteria: (searchCriteria: ISearchCriteria, stack: StackNames) => void;
resetProductState: () => void;
isFocused: boolean;
}
接口是ScreenProps{
导航:导航屏幕弹出;
部门:NavigationNode[]|空;
updateSearchCriteria:(searchCriteria:ISearchCriteria,stack:StackNames)=>void;
resetProductState:()=>void;
isFocused:布尔;
}
组成部分
class SearchScreen extends React.Component<IScreenProps, IScreenState> {
.....
}
export default connect(mapStateToProps, mapDispatchToProps)( withNavigationFocus(SearchScreen));
class SearchScreen扩展了React.Component{
.....
}
导出默认连接(mapStateToProps、mapDispatchToProps)(带导航焦点(搜索屏幕));
没有生成错误,在searchScreen导出的编辑器/IDE中仍显示红线。我在下面附上了我面临的错误
请告诉我如何解决此问题。使用
NavigationStackProp
(或根据您的导航器使用的相关工具),而不是NavigationScreenProp
interface IScreenProps {
navigation: NavigationStackProp<IParamsNavigate>;
departments: NavigationNode[] | null;
updateSearchCriteria: (searchCriteria: ISearchCriteria, stack: StackNames) => void;
resetProductState: () => void;
isFocused: boolean;
}
接口是ScreenProps{
导航:NavigationStackProp;
部门:NavigationNode[]|空;
updateSearchCriteria:(searchCriteria:ISearchCriteria,stack:StackNames)=>void;
resetProductState:()=>void;
isFocused:布尔;
}
我正在使用react navigation v3。NavigationStackProp不可用。请提出其他相关的解决方案