question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
zouhircommented, Mar 16, 2018

I’ll look at it next week, if you have time & can help happy to merge it earlier ❤️

1reaction
zouhircommented, Jul 5, 2018

Releasing in the next few hours @sampotts!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found