Skip to content

Commit 5118a8a

Browse files
committed
allow jotaiStore to be passed into DailyProvider
1 parent f7b6299 commit 5118a8a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/DailyProvider.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,21 @@ import { DailyRoom } from './DailyRoom';
2020
import { DailyTranscriptions } from './DailyTranscriptions';
2121
import { useCallObject } from './hooks/useCallObject';
2222

23-
type Props =
23+
type BaseProps =
2424
| DailyFactoryOptions
2525
| {
2626
callObject: DailyCall | null;
2727
};
2828

29+
type Props = BaseProps & {
30+
jotaiStore?: React.ComponentProps<typeof Provider>['store'];
31+
};
32+
2933
type EventsMap = Partial<Record<DailyEvent, Map<number, Function>>>;
3034

3135
export const DailyProvider: React.FC<React.PropsWithChildren<Props>> = ({
3236
children,
37+
jotaiStore,
3338
...props
3439
}) => {
3540
const eventsMap = useRef<EventsMap>({});
@@ -126,7 +131,7 @@ export const DailyProvider: React.FC<React.PropsWithChildren<Props>> = ({
126131
);
127132

128133
return (
129-
<Provider>
134+
<Provider store={jotaiStore}>
130135
<DailyContext.Provider value={callObject}>
131136
<DailyEventContext.Provider value={{ on, off }}>
132137
<DailyRoom>

0 commit comments

Comments
 (0)