Preparations for React 18 (#12860)
* Add missing types Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Eagerly add `children` to props in prep for React 18 Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Avoid assuming that setState immediately sets `this.state` values Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Add missing context declaration Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Fix UserFriendlyError types to work with React 18 Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
accbe07439
commit
090586439f
17 changed files with 63 additions and 44 deletions
|
@ -97,6 +97,12 @@ type WithKeyFunction<T> = T extends Key
|
|||
toKey: (key: T) => Key;
|
||||
};
|
||||
|
||||
export interface AdditionalOptionsProps {
|
||||
menuDisplayed: boolean;
|
||||
closeMenu: () => void;
|
||||
openMenu: () => void;
|
||||
}
|
||||
|
||||
type IProps<T> = WithKeyFunction<T> & {
|
||||
value: T;
|
||||
options: readonly GenericDropdownMenuOption<T>[] | readonly GenericDropdownMenuGroup<T>[];
|
||||
|
@ -105,11 +111,7 @@ type IProps<T> = WithKeyFunction<T> & {
|
|||
onOpen?: (ev: ButtonEvent) => void;
|
||||
onClose?: (ev: ButtonEvent) => void;
|
||||
className?: string;
|
||||
AdditionalOptions?: FunctionComponent<{
|
||||
menuDisplayed: boolean;
|
||||
closeMenu: () => void;
|
||||
openMenu: () => void;
|
||||
}>;
|
||||
AdditionalOptions?: FunctionComponent<AdditionalOptionsProps>;
|
||||
};
|
||||
|
||||
export function GenericDropdownMenu<T>({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue