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

bugfix(react-utilities): change SlotRenderFunction signature to include children #27377

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "bugfix: increments SlotRenderFunction signature to include children",
"packageName": "@fluentui/react-utilities",
"email": "bernardo.sunderhus@gmail.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export type SlotClassNames<Slots> = {
export type SlotPropsRecord = Record<string, UnknownSlotProps | SlotShorthandValue | null | undefined>;

// @public (undocumented)
export type SlotRenderFunction<Props> = (Component: React_2.ElementType<Props>, props: Omit<Props, 'children' | 'as'>) => React_2.ReactNode;
export type SlotRenderFunction<Props> = (Component: React_2.ElementType<Props>, props: Omit<Props, 'as'>) => React_2.ReactNode;

// @public (undocumented)
export type Slots<S extends SlotPropsRecord> = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function getSlot<R extends SlotPropsRecord, K extends keyof R>(
return [
React.Fragment,
{
children: render(slot, rest as Omit<R[K], 'children' | 'as'>),
children: render(slot, rest as Omit<R[K], 'as'>),
} as unknown as R[K],
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';

export type SlotRenderFunction<Props> = (
Component: React.ElementType<Props>,
props: Omit<Props, 'children' | 'as'>,
props: Omit<Props, 'as'>,
) => React.ReactNode;

/**
Expand Down