Skip to content
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

fix: simplify element before stringifying to avoid crash on docs page #19188

Merged
merged 2 commits into from
Jan 13, 2023

Conversation

donotlb
Copy link
Contributor

@donotlb donotlb commented Sep 14, 2022

Issue: #17482

What I did

Recursively remove the "_owner" property from elements to avoid crash on docs page when passing components as array prop

How to test

replace the following code

export const Text = () => <Button>Hello Button</Button>;

with export const Text = (args) => <Button arrayProp={[<div />]}>Hello Button</Button>;

  1. start examples/cra-ts-kitchen-sink
  2. open the "?path=/docs/1-button--docs" story

Related issues

Copy link
Member

@ndelangen ndelangen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably add some test for this somewhere. @shilman WDYT?

@posabsolute
Copy link

Any News on this fix @ndelangen? I am also experiencing this issue, looking at your backlog, I believe many people are experiencing it too:

@shilman shilman added the linear label Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants