[BUG] Conditionally rendered children components not staggering
See original GitHub issue1. Describe the bug
Children components wrapped in AnimatePresence
don’t stagger as they should if they are not rendered initially. In provided example, you can see a comparison between child components mapped initially from static data array (works fine) and rendered conditionally, e.g. after some remote data is fetched, which is a common scenario.
2. CodeSandbox reproduction of the bug https://codesandbox.io/s/staggerchildrenissue-tkkie?file=/src/App.js
3. Steps to reproduce Refresh provided codesandbox example.
4. Expected behavior Children components rendered conditionally should be staggered the same as the ones rendering initially.
5. Environment details KDE neon 5.19, Chrome 85.0.4183.102 (Official Build) (64-bit)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:6
Top Results From Across the Web
Child component not re-rendering when parent re ... - Reddit
In the counter component, I am rendering button which changes the state of counter component and also rendering Logger component. I am not...
Read more >conditional rendering is not happening to display child ...
I am trying to render conditionally to display child component. But it is not happening. on button click i am getting the values,...
Read more >Staggering components on enter with react css transition group
I looked at this question but would like to try do it using the react transitions group.
Read more >Props and Conditional Rendering - DEV Community
The unidirectional data flow concept simply means that data can only be passed from the parent to the child component and not the...
Read more >Conditional React Context: Treating Each Consumer Differently
Here's the mount profile where everything is rendered. We add an Indirection component in the middle to hold the following two consumers Child...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It makes no sense if it’s not able to perform on the dynamic data.
Yes but that only helps if the parent did not have their own transitions. A key change would reset this transition.
The use of this feature is limited if it did not work if children get added after the parent transition start.
I have made a small Sandbox for demonstration for my ticket: Example Toggle Demo1: Expected behavior Toggle Demo2: Example with children added after timeout