-
Notifications
You must be signed in to change notification settings - Fork 85
Fix recursion with react elements #883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@armandabric could you take a look please? |
I will not merge this I did not have bandwidth to support react 18 and react 19 in parallel. If this is an issue in storybook I advice you to push on storybook side as they use this package from years without helping in any kind. |
Hello @armandabric 👋 Storybook maintainer here, Seems You were in touch with @shilman a long time ago, to talk about giving this package a new home (under the storybook org, I assume). I'd be happy to move the package to the storybookjs org. |
Well, I want to clarify that this problem exists in react 19 too. It's not unique for storybook. It could happen in any react environment, see #312 (comment) |
Hey! Yes I got in touch with @shilman for that. I'm glad that you are considering to offer a new home for this plugin 😄 Where should we discuss of this? I'm on the storybook discord if needed. |
Ho! I miss read the issue. We could fix it on the latest branch. I will review the PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If not too complicated to write, can you add a test that check that the _owner
key is removed from react elements?
All good, thanks @7rulnik for the fix |
Fix released on v17.0.1 |
It fixes #681
The bug was introduced in #619.
It's not a first time since we encounter this issue, see #307 and especially #312 (comment).
I faced it in storybook and managed to reproduce it using this story:
but couldn't write test case for it. I tried to reproduce it using code snippet from #312 (comment) with latest react and react-element-to-jsx-string but couldn't for some reasons.
So this is why I decided to add test directly to
src/formatter/sortObject.spec.js
It also should fix storybookjs/storybook#16827.
I suggest to backport it to v15 because people mostly use react 18 right now:
