import reducer, { defaultState } from "./reducer"; import React from "react"; import { CompletionDispatchContext, CompletionStateContext } from "./context"; interface Props { initialInputValue: string; } export const CompletionProvider: React.FC = ({ initialInputValue, children, }) => { const initialState = { ...defaultState, completionSource: initialInputValue, }; const [state, dispatch] = React.useReducer(reducer, initialState); return ( {children} ); };