Closed mmdevcodes closed 3 years ago
I am having the same issues in case this gets resolved
I tracked this error down and I think that's because the index.ts
file exports both versions of the createStackNavigator
export { default as createSharedElementStackNavigator4 } from "./v4/createSharedElementStackNavigator";
export { default as createSharedElementStackNavigator } from "./createSharedElementStackNavigator";
and if you open the v4/createSharedElementStackNavigator.ts
you can find those imports
import { ... } from "react-navigation";
import { ... } from "react-navigation-stack";
I don't know if we need some king of tree shaking but that seems odd to do in development 🤔
Waiting for someone with a greater knowledge... Le dot.
This issues is actually fixed in the v5 branch of the this library- select the v5 branch and follow instructions from there
https://github.com/IjzerenHein/react-navigation-shared-element/tree/navigation-v5
I tracked this error down and I think that's because the
index.ts
file exports both versions of thecreateStackNavigator
export { default as createSharedElementStackNavigator4 } from "./v4/createSharedElementStackNavigator"; export { default as createSharedElementStackNavigator } from "./createSharedElementStackNavigator";
and if you open the
v4/createSharedElementStackNavigator.ts
you can find those importsimport { ... } from "react-navigation"; import { ... } from "react-navigation-stack";
I don't know if we need some king of tree shaking but that seems odd to do in development
Waiting for someone with a greater knowledge... Le dot.
I try to change import location for the createStackNavigator, CardAnimationContext
in the createSharedElementStackNavigator
and works.
import { createStackNavigator, CardAnimationContext, } from "@react-navigation/stack";
I'm facing this issue too, how do i fix this?
Thanks a lot to @enestatli it fixed my problem.
Following these steps may solve it for you too:
1) Go to your node modules and find 'react-navigation-shared-element' folder. 2) Navigate to node_modules/react-navigation-shared-element/build/v4 and open createSharedElementStackNavigator.ts file into your editor. 3) change the import FROM import { createStackNavigator, CardAnimationContext, } from "react-navigation-stack"; TO import { createStackNavigator, CardAnimationContext, } from "@react-navigation/stack"; 4) Close and rebuild app and the error should be gone
A new major version has just been released that addresses this problem. The earlier 3.0.0
prerelease was a bit clunky and required both react-navigation 4 and 5 to be included in your dependencies. This has been reworked and you can find instructions on usage and migration in the main README.
im using lasted version v3.1.3 but still got this error??
I installed the @3 version and I get the following error after running
expo start
:My packages in package.json for reference:
Details