react-native-shared-element
react-native-shared-element copied to clipboard
Multiple SharedElement not working.
Hi Thanks for providing this awesome lib for smooth transitions.
Recently, I have started using this lib in my React Native project, and I am happy with the animation, but I, also facing an issue.
Issue Details:- Using createSharedElementStackNavigator for navigator and as per example placing unique ids for the SharedElements which needs to be animated.
sharedElements={(route, otherRoute, showing) => {
const { slug, isFrom } = route.params;
return [
{
id: item.${slug}${isFrom}.photo
,
animation: "fade",
resize: "stretch",
align: "center-top",
},
{
id: item.${slug}${isFrom}.name
,
animation: "fade",
resize: "clip",
align: "left-center",
},
{
id: item.${slug}${isFrom}.dineInOptions
,
animation: "fade",
resize: "clip",
align: "left-center",
},
];
}}
for one Screen it's working fine but in same navigator if I set above values with different unique ids to another screen, then on second screen SharedElement does not work.
If I remove sharedElements prop from one screen then only second one works and vice versa. I can't see SharedElement works for multiple screens.
Please let me know if we can use this for multiple screen. If you guys need sample please let me know.
Effected Platform : Android and iOS
Any help is appreciated. Thanks
Hey! Thanks for opening the issue. The issue doesn't seem to contain a link to a repro (a snack.expo.dev link or link to a GitHub repo under your username).
Can you provide a minimal repro which demonstrates the issue? A repro will help us debug the issue faster. Please try to keep the repro as small as possible and make sure that we can run it without additional setup.
This is an issue related to react-navigation-shared-element. I copied your issue description there and I'll close the issue here.
Hi @p-syche Thanks, for your reply can you tell me how to solve this issue..as you found the root cause of this issue.