React native: Do not re-render the list intentionally while adding the items #3480
Unanswered
SourceCipher
asked this question in
Q&A
Replies: 1 comment 3 replies
-
I doubt it's related to Mobx, did you try to swap mobx with useState here? By the way you may try reproducing the issue and share the link: https://snack.expo.dev/@trin4ik/mobx-theme-provider It would help us to help you, because currently none of the maintainers have experience with React Native |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a small app where I am testing the animations for the items. Basically when I swipe the item, it gets removed from the list and the animation is continued for like 0.5s. The problem is that the mobx updates the array when the item is removed from it and it cancels out the animation. So instead of animation continuing to show removal or addon effect, it just disappears quickly.
How do I avoid this? Same idea for example if I fetch the data when only 2 items left and the array is topped up, I get the same animation cancelling effect.
To show how I am rendering the components would be something like this:
` private renderCards = () => {
const {fakeData, currentTheme} = this.props.mainStore
}`
Example to replicate is here https://snack.expo.dev/Jh0Vk0cTX
Beta Was this translation helpful? Give feedback.
All reactions