Currently, I am developing an app with React Native and TypeScript, utilizing React Navigation for routing purposes.
In the sample project that I downloaded, they utilized StackNavigator({...})
to create the navigator. However, upon running npm start
, a warning appears indicating that StackNavigator
is deprecated and suggests using createStackNavigator
instead, which is also shown in online tutorials.
The issue arises when implementing createStackNavigator
, as an error occurs:
[ts] Module '".../.../..."' has no exported member 'createStackNavigator'.
After examining the index.d.ts
file within the path, it became evident that this member was indeed missing. Despite attempting
npm install @types/react-navigation@latest
, the issue persists.
How can I successfully utilize createStackNavigator
? Alternatively, should I rely on the outdated StackNavigator
?