Problemunvalidated
When toggling hiddenFlag, the same number of MyComponent instances are shown, but their internal state (e.g., a counter) may be preserved for the wrong instance depending on whether components are conditionally rendered with an if/ternary or with inline logical rendering. How does React decide which component instance is the 'same' one?
d7e4112b-f5bc-4c43-9c45-5371c0827212
When toggling hiddenFlag, the same number of MyComponent instances are shown, but their internal state (e.g., a counter) may be preserved for the wrong instance depending on whether components are conditionally rendered with an if/ternary or with inline logical rendering. How does React decide which component instance is the 'same' one?