Passed props bleed to subsequent instances
See original GitHub issue
<div class="my-component">
<script type="text/props">
{"a": 1, "b": 2}
</script>
</div>
<div class="my-component">
<script type="text/props">
{"a": 3}
</script>
</div>
habitat(MyComponent).render({
selector: '.my-component'
});
The second instance will receive {"a": 3, "b": 2}
If I understand correctly it is caused by directly mutating props in collectPropsFromElement
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Pass props to all instances of same component - Stack Overflow
In my React app I am conditionally rendering views depending on which button is clicked in my menu component by passing the a...
Read more >Previous render sometimes leaking into next test #716 - GitHub
Using await before renderComponentWithMockCookies in either test; Passing a regex instead of a string to screen.findByText in the second test.
Read more >How passing props to component works in React
Master how to pass props (properties) to components in React with this useful beginner's guide, including demo code.
Read more >Check for extraneous props in React (and save hours of ...
This article explains how to check that all props passed down to your React components are the right ones, so you never wonder...
Read more >The Red Stuff: A Guide to Letting It Bleed Onstage
Jennifer McClure's new book provides a prop master's guide to blood effects, from design to clean-up and every sanguinary step in between.
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
I’ll look at it next week, if you have time & can help happy to merge it earlier ❤️
Releasing in the next few hours @sampotts!