Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Typescript错误-don';不要将函数用作类型_Typescript_React Native - Fatal编程技术网

Typescript错误-don';不要将函数用作类型

Typescript错误-don';不要将函数用作类型,typescript,react-native,Typescript,React Native,我已经开始在我的React Native项目中使用TypeScript 我的linter不喜欢函数作为类型,我如何重构我的hoc来传递我的linter AppNavigator: const withHeader = ( screen: Function, routeName: string, Header, ): StackNavigator => createStackNavigator( { [routeName

我已经开始在我的
React Native
项目中使用
TypeScript

我的linter不喜欢函数作为类型,我如何重构我的hoc来传递我的linter

AppNavigator:

const withHeader = (
    screen: Function,
    routeName: string,
    Header,
): StackNavigator =>
    createStackNavigator(
        {
            [routeName]: {
                screen,
                navigationOptions: ({routeName, props}) => ({
                    header: props => <Header {...props} />,
                }),
            },
        },
        {
            initialRoute: 'Home',
            cardStyle: {
                backgroundColor: 'transparent',
                opacity: 1,
            },
            transitionConfig: () => ({
                containerStyle: {
                    backgroundColor: 'transparent',
                },
            }),
        },
    );

键入一个更具体的函数
()=>{}
<代码>函数是
任何
函数。我已经改变了这一点,林特仍然给我同样的错误你说的“我的林特不喜欢”具体是什么意思?我认为,如中所述,您应该提供有关
函数
的具体错误,以及它发生的位置,以及linter配置的外观。足够有人诊断了。否则很难提出建议。哦,底部的错误似乎是一个单独的问题,对吗?检查这是否回答了您的第一个问题。将其作为更具体的函数键入
()=>{}
<代码>函数是
任何
函数。我已经改变了这一点,林特仍然给我同样的错误你说的“我的林特不喜欢”具体是什么意思?我认为,如中所述,您应该提供有关
函数
的具体错误,以及它发生的位置,以及linter配置的外观。足够有人诊断了。否则很难提出建议。哦,底部的错误似乎是一个单独的问题,对吗?检查这是否回答了你的第一个问题
error: bundling failed: Error: Unable to resolve module `./navigation/AppNavigator` from `C:\Users\Matt\sites\IAapp\App.tsx`: The module `./navigation/AppNavigator` could not be found from `C:\Users\Matt\sites\IAapp\App.tsx`. Indeed, none of these files exist: