IjzerenHein / IjzerenHein/react-native-shared-element
Support ModalPresentationIOS transition preset
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 113
- PR merge metrics
- No merged PRs in 30d
Description
The animation begins smoothly, but when the animation finishes, the items (`SharedElement`s) are off by some pixels which causes this stuttering glitch. This issue only appears when using the `ModalPresentationIOS` transition preset. All other presets work fine.
Demo here:

My Navigator:
```js
const SharedElementStack = createSharedElementStackNavigator();
function HomeSharedElementStackNavigator() {
return (
{
const {item} = route.params;
return [
{
id: `item.${item.id}.image`,
animation: 'fade',
},
{
id: `item.${item.id}.title`,
animation: 'fade',
},
{
id: `item.${item.id}.description`,
animation: 'fade',
},
];
}}
/>
);
}
```
I've tried playing around with the `animation` property, but I can't seem to get it working with this animation I found in the example project (`springyFadeIn.js`):
```js
import {Animated} from 'react-native';
export function springyFadeIn() {
const transitionSpec = {
timing: Animated.spring,
tension: 10,
useNativeDriver: true,
};
return {
transitionSpec,
screenInterpolator: ({position, scene}) => {
const {index} = scene;
const opacity = position.interpolate({
inputRange: [index - 1, index],
outputRange: [0, 1],
});
return {opacity};
},
};
}
```
Packages used:
```json
// ...
"react": "16.9.0",
"react-native": "0.61.5",
"react-navigation-shared-element": "^5.0.0-alpha1",
// ...
```
I don't know if that's a bug in the library or if I am making a mistake, would appreciate some help here!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the transition using the provided SharedElementStack navigator and the ModalPresentationIOS preset with the listed React Native and react-navigation-shared-element versions. Compare it with the other presets and the springyFadeIn example; the issue is done when SharedElements no longer shift or stutter at the end of the transition.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react-native
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100