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

Ensure undefined props do not overwrite defaults #2852

Merged
merged 1 commit into from Apr 4, 2024

Conversation

carbonrobot
Copy link
Contributor

@carbonrobot carbonrobot commented Apr 4, 2024

Ensure undefined props do not overwrite defaults

In previous updates, some functional components were changed to use the spread operator for assigning default values to component props. This inadvertently had the effect of preventing consumers from setting props to undefined.

Before this change

// usage
<VictoryChart />

// final props
{ containerComponent: <VictoryContainer /> }

// usage
<VictoryChart containerComponent={undefined} />

// final props
{ containerComponent: undefined }

After this change

// usage
<VictoryChart />

// final props
{ containerComponent: <VictoryContainer /> }

// usage
<VictoryChart containerComponent={undefined} />

// final props
{ containerComponent: <VictoryContainer /> }

Fixes #2848

Copy link

vercel bot commented Apr 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
victory ⬜️ Ignored (Inspect) Apr 4, 2024 4:51pm

Copy link

changeset-bot bot commented Apr 4, 2024

🦋 Changeset detected

Latest commit: 78ad17a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 31 packages
Name Type
victory-area Patch
victory-bar Patch
victory-candlestick Patch
victory-chart Patch
victory-core Patch
victory-errorbar Patch
victory-group Patch
victory-line Patch
victory-native Patch
victory-pie Patch
victory-stack Patch
victory-tooltip Patch
victory-voronoi Patch
victory-axis Patch
victory-box-plot Patch
victory-brush-container Patch
victory-brush-line Patch
victory-canvas Patch
victory-create-container Patch
victory-cursor-container Patch
victory-histogram Patch
victory-legend Patch
victory-polar-axis Patch
victory-scatter Patch
victory-selection-container Patch
victory-shared-events Patch
victory-vendor Patch
victory-voronoi-container Patch
victory-zoom-container Patch
victory Patch
victory-docs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@carbonrobot carbonrobot merged commit 8c4cbe7 into main Apr 4, 2024
9 checks passed
@carbonrobot carbonrobot deleted the fix/undefined-props branch April 4, 2024 17:35
@victory-ci victory-ci mentioned this pull request Apr 4, 2024
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.

Undefined containerComponent results in TypeError
2 participants