Skip to content

Commit

Permalink
fix(types): Add support for props that exist on downstream providers …
Browse files Browse the repository at this point in the history
…whose props are derived from prop spreading (#2073)

Add support for props that exist on downstream providers whose props are derrived from prop spreading
  • Loading branch information
union-zakbutcher authored Apr 16, 2024
1 parent 3bef6fd commit 7dcdd95
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/contexts/RootProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,21 @@ import { NavigationProvider } from './Navigation';
import { SelectMultipleProvider } from './SelectMultiple';
import { SelectRangeProvider } from './SelectRange';
import { SelectSingleProvider } from './SelectSingle';
import { DayPickerDefaultProps } from 'types/DayPickerDefault';
import { DayPickerSingleProps } from 'types/DayPickerSingle';
import { DayPickerMultipleProps } from 'types/DayPickerMultiple';
import { DayPickerRangeProps } from 'types/DayPickerRange';

type RootContextProps =
| Partial<DayPickerDefaultProps>
| Partial<DayPickerSingleProps>
| Partial<DayPickerMultipleProps>
| Partial<DayPickerRangeProps>;

/** The props of {@link RootProvider}. */
export interface RootContext {
export type RootContext = RootContextProps & {
children?: ReactNode;
}
};

/** Provide the value for all the context providers. */
export function RootProvider(props: RootContext): JSX.Element {
Expand Down

0 comments on commit 7dcdd95

Please sign in to comment.