Nesting an If alongside an element causes key problems
See original GitHub issueIf you have something like this:
<If condition={aCondition}>
<span>Blah</span>
<If condition={anotherCondition}>
<span>Other Blah</span>
</If>
</If>
It seems to cause
warning.js:46 Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of `FeatureInfoSection`. See https://fb.me/react-warning-keys for more information.
Goes away if you do
<If condition={aCondition}>
<span>Blah</span>
<If condition={anotherCondition}>
<span key='otherblah'>Other Blah</span>
</If>
</If>
Looks like it’ll be an annoying fix 😦
Issue Analytics
- State:
- Created 7 years ago
- Reactions:5
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Object spreads with nested children gives unwanted key ...
So I would like to know if this is correct behaviour or a bug. ... Render a component which spreads attributes on it's...
Read more >Common nesting issues in HTML
Here are some examples of common nesting issues in HTML. ... Error message in the HTML validator: The element button must not appear...
Read more >Vue deleting a nested loop element causes an error
Whenever I delete anything that is not the latest subrule it throws an error which is on the v-if statement in determining which...
Read more >5.2. Data Access Pattern Problems
Inefficient loop nesting is a problem specific to algorithms that work on multidimensional arrays. If the array is traversed along the wrong axis...
Read more >CSS Nesting Module
Abstract. This module introduces the ability to nest one style rule inside another, with the selector of the child rule relative to the ......
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
Fixed in v3.1.3! 💃
works for me as well @texttechne thanks for the fix!