We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
useVariable
1 parent e0ef1c7 commit 9ac7dcaCopy full SHA for 9ac7dca
src/react/hooks.ts
@@ -163,7 +163,9 @@ export function useVariable(
163
id: string,
164
): [WorkbookVariable | undefined, Function] {
165
const client = usePlugin();
166
- const [workbookVariable, setWorkbookVariable] = useState<WorkbookVariable>();
+ const [workbookVariable, setWorkbookVariable] = useState<WorkbookVariable>(
167
+ client.config.getVariable(id),
168
+ );
169
170
useEffect(() => {
171
return client.config.subscribeToWorkbookVariable(id, setWorkbookVariable);
0 commit comments