-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[TagInput] values accepts any valid JSX #1419
Conversation
with lots of notes about how to simplify your typescript code
TagInput values accepts any valid JSX with lots of notes about how to simplify your typescript codePreview: documentation |
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.
totally fine, and useful to support bold, italics and such 👍JSX.Element
is probably too broad
Do we use |
@adidahiya we use that said, the difference btw |
comments on values typesPreview: documentation |
how so? isn't this the case with |
@adidahiya it is not the case with |
ok, makes sense. |
Addresses #1412
Changes proposed in this pull request:
values
array now acceptsReact.ReactNode[]
, which is actually the same type aschildren
! not usingchildren
for this makes the array nature explicit. One cool thing is you can now pass an array to do inline styling:values: ["Barney", ["Bar", <em>thol</em>, "emew"], "Bertha"]
had to widen the types of a few props to support this (but actually added only one line of actual code), so I added some notes to props docs about how you can declare your own simpler types on your handlers.
Reviewers should focus on:
ReactNode
is basically the most permissive type out there. Do we want to be a little more strict likestring | JSX.Element
?Screenshot