IjzerenHein / IjzerenHein/react-navigation-shared-element

Multiple shared elements

Open
#250 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.3k
Forks
125
PR merge metrics
No merged PRs in 30d

Description

copied from https://github.com/IjzerenHein/react-native-shared-element/issues/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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from createSharedElementStackNavigator and the sharedElements configuration shown in the issue, then reproduce the behavior with multiple screens on Android and iOS. Done means shared-element transitions work for each screen without removing another screen's sharedElements prop.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, typescript
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.