diff --git a/src/react/hooks.ts b/src/react/hooks.ts index c6108ff..f539ca5 100644 --- a/src/react/hooks.ts +++ b/src/react/hooks.ts @@ -163,7 +163,9 @@ export function useVariable( id: string, ): [WorkbookVariable | undefined, Function] { const client = usePlugin(); - const [workbookVariable, setWorkbookVariable] = useState(); + const [workbookVariable, setWorkbookVariable] = useState( + client.config.getVariable(id), + ); useEffect(() => { return client.config.subscribeToWorkbookVariable(id, setWorkbookVariable);