Comments (5)
Hi @tafelito,
I was experiencing the same problem as you,
1 or 2 times every 5 transitions it wasn't positioning the image correctly.
In case this solution is fine for you: I tried adding the cardStyleInterpolator
option to the Detail Screen, so it fades from the list to the detail, and it works 100% of the time!
I just used the example found at https://reactnavigation.org/docs/stack-navigator/#cardstyleinterpolator
in the <Navigator>
component, I defined this function:
const forFade = ({ current, closing }) => ({
cardStyle: {
opacity: current.progress,
},
})
and then I just added the option to the Screen on that same file:
<Stack.Screen
...
options={{ cardStyleInterpolator: forFade }}
... >
...hope it helps!
from react-navigation-shared-element.
Hmm, not sure might be related to #24 Could you try and see whether this workaround works?
#24 (comment)
from react-navigation-shared-element.
I tried changing the transitionSpec as you suggested. Even tho it works most of the time, it did fail 1 or 2 times. What I did notice is that now the navigation seems to be a bit laggy, specially when you swipe back.
I think that if you start the swipe back before the transitions ends, that's when it fails or you can see the lag
Is the shared transition supposed to happen when swiping back and not with the back on the header?
from react-navigation-shared-element.
@JaviEzpeleta's fix worked for me as well. Thank you
from react-navigation-shared-element.
Hi! Please upgrade to the latest official version. Lots of things have been fixed and the native extensions have also received a bunch of bug fixes. Feel free to reopen with a PR for a test-case in the example
app when this problem still occurs.
from react-navigation-shared-element.
Related Issues (20)
- Experiencing white flashes when transitioning between screens. HOT 1
- Hello, both state and getParam are deprecated. Any work arounds? HOT 1
- Scrollview with createSharedElement HOT 1
- Transition not working when navigate back with finger gesture (IOS) HOT 7
- Shared element is shifting while navigating to main screen HOT 10
- Shared element with placement shifting with 'modal' HOT 4
- The animation does pop the image back to its original spot with a nested navigator.
- Border Flicker during transition HOT 1
- RNSharedElementTransition is not available, did you forget to link `react-native-shared-element HOT 3
- Looking forward for Typed version of this stack navigation
- Check the render method Jest mock error on SharedElement HOT 1
- Check the render method Jest mock error on SharedElement
- Issue when navigate to a screen while current screen has shared-element HOT 4
- BUG CRASH: Maximum call stack size exceeded (native stack depth) HOT 3
- Transitioning in and out with different elements HOT 2
- [Question] How to set dynamic id? HOT 1
- attempt to invoke virtual method android.graphics.rect.android.graphics.drawables.getbounds() on a null objaect reference HOT 4
- Flickering just before screen transition (only Android) HOT 2
- Not working with newArchEnabled HOT 2
- shared element not working correctly with expo 50 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-navigation-shared-element.