-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[docs]: improve Storybook prop table for Slot<T>
type
#27105
Comments
We should tackle this, documentation will become more important in the future. If someone has time to pick this up and make this focused fix, feel free. Note that you'll want to sync with @tudorpopams regarding the Fluent 2 website. Otherwise we can tie this up as part of a storybook improvement initiative that we'll schedule explicitly. |
I think @ling1726 has some insight into the work required for this change. If this is a lot of work perhaps a good simple(r?) first step is to include a link to the slot documentation at the top of every prop table? |
I came here from #26976. Without looking through closed issues, I wouldn't know how to disable or handle primary button clicks on SplitButton. |
Because this issue has not had activity for over 150 days, we're automatically closing it for house-keeping purposes. Still require assistance? Please, create a new issue with up-to date details. |
I have some info on how this happens Here's a minimal example of type inferences happening behind the scene on TS compiler side. type X = {
a: 'a',
b: 'b',
c: 'c'
} | null | undefined
// if you hover over you'll see x:X
declare const x: X
// if you hover over you'll see that instead of having nonNullableX: NonNullable<X>
// TS has inferred the new constructing type because it had to find out what would be the intersection between
// 'X' and everything but `null` and `undefined`
// so if you hover over you'll see a new type! nonNullableX: {
// a: 'a';
// b: 'b';
// c: 'c';
// }
declare const nonNullableX: NonNullable<X> TS basically has to calculate what would be the new type (in the example case, it calculates the intersection between To solve this problem on our case (at least if we want to solve on TS side of it) we'd have to stop manipulating our types declarations so much on a slot declaration (every time we use |
This is not a documentation issue. it's a TS issue on Slot API, the storybook docgen is only reflecting this problem |
Library
React Components / v9 (@fluentui/react-components)
Describe the feature that you would like added
I'd like to prop table documentation for props that are of type
Slot<T>
to be better.For example, this is the documentation for Avatar's icon slot
This is the type in source:
Slot<'span'>
I propose that:
Slot<'span'>
)This will make the docs cleaner and easier to understand and point readers in the right direction so they can learn about Fluent's slot API.
Have you discussed this feature with our team
@Hotell, @spmonahan
Additional context
This came us as a result of #26976
Related:
Validations
The text was updated successfully, but these errors were encountered: