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.
1 parent 2c46c19 commit b2f2c63Copy full SHA for b2f2c63
packages/docs-md/src/assets/TryItNow/hooks/useTranspiledCode.ts
@@ -32,7 +32,8 @@ export const useEvaluatedCode = (): string | null => {
32
useEffect(() => {
33
listen((msg: SandpackMessage) => {
34
if (msg.type === "status" && msg.status === "evaluating") {
35
- const transpiledCode = getTranspiledCode(client!);
+ if (!client) return;
36
+ const transpiledCode = getTranspiledCode(client);
37
if (transpiledCode) {
38
setEvaluatedCode(transpiledCode);
39
}
0 commit comments