Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple shared elements #250

Open
p-syche opened this issue Sep 29, 2022 · 3 comments
Open

Multiple shared elements #250

p-syche opened this issue Sep 29, 2022 · 3 comments

Comments

@p-syche
Copy link
Collaborator

p-syche commented Sep 29, 2022

copied from IjzerenHein/react-native-shared-element#103 by @devggm

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

@takahiro-saeki
Copy link

any update?

@p-syche
Copy link
Collaborator Author

p-syche commented Jan 26, 2023

@takahiro-saeki not yet, but hopefully soon :)

@devggm
Copy link

devggm commented Feb 6, 2023

@p-syche I, noticed that sometimes the animation works from a particular place, for example I have used shared element at 4 different places and one of them works then from other places it won't work. and this behaviour is also works randomly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants