Skip to content

Conversation

@darekrossman
Copy link

When attempting to render a component's props in the story source pane – when a component has an object for a prop like style, previewProp() was attempting to render a literal object with the key content, which causes a React error. Seems the intention of the original code was to render the literal characters "{" and "}" around content.

Issue:

What I did

Changed the final case in previewProp where content was being set as a <span>. Replaced intended functionality to render literal brace characters.

How to test

Cloned the latest branch and attempted to link addons-info in another project.

.addWithInfo('div', () => (
  <div style={{ color: 'red' }}>Oops</div>
)

Seems passing in any object as ay prop triggers a React error.

When attempting to render a component's props in the story source pane – when a component has an object for a prop like `style`, `previewProp()` was attempting to render a literal object with the key `content`, which causes a React error. Seems the intention of the original code was to render the literal characters `"{"` and `"}"` around `content`.
@nx-cloud
Copy link

nx-cloud bot commented Mar 15, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 0a85d31. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants