I have started to use TypeScript in my React-Native project
My linter doesn't like function as a type, how can I refactor my hoc to pass my 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',
},
}),
},
);
My packager also gives me an error with the same file:
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:
() => {}.Functionisanyof functions.Functionand where it occurs, and what your linter config looks like. Enough for someone to diagnose. Otherwise it'll be hard to advise. Oh, and the error at the bottom seems to be a separate question, right?