Skip to content

Commit

Permalink
bugfix(react-utilities): increments SlotRenderFunction signature to i…
Browse files Browse the repository at this point in the history
…nclude children (#27377)
  • Loading branch information
bsunderhus authored Apr 3, 2023
1 parent 15a497f commit 60f7139
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
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

0 comments on commit 60f7139

Please sign in to comment.