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(Alert): changes to type #2759

Draft
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

elaffen
Copy link
Contributor

@elaffen elaffen commented Nov 9, 2024

Changed Alert's children type to ReactNode. Prop-list in Storybook indicated that children was of type 'string'. That is not correct. And it is somewhat confusing and not consistent that children in other components not are listed in Storybook's prop-list. Chip for example has children, but it's not listed in the prop-list.

Copy link

changeset-bot bot commented Nov 9, 2024

⚠️ No Changeset found

Latest commit: d27ce0b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@mimarz
Copy link
Collaborator

mimarz commented Nov 11, 2024

Good morning!

Thanks for the PR and bringing this to our attention :)

We extend/join the default prop types for the native element used in a component (HTMLAttributes<HTMLDivElement>) so the type is already ReactNode.

Its not shown in the props table because Storybook filters away native props, so the props table is more of a table of props that differ from the underlying element.

image

Here it looks like the default value used for the preview story is used as the prop type displayed in the props for some reason 🤔

I would like to investigate this closer as we need to we need to find a solution to the core problem here that works for all components and future components. Having to manually remember to override specific native props on components is cumbersome to maintain and prone for errors.

I have made a new bug issue to follow up this: 2760

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