From 103085684a056be8a80d9ff4e1ee1c94976b83dd Mon Sep 17 00:00:00 2001 From: Corwin Date: Sat, 20 Apr 2024 13:43:42 +0100 Subject: [PATCH] get value that depends on being run in the client in an effect --- website/agb/src/app/crash/backtrace.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/website/agb/src/app/crash/backtrace.tsx b/website/agb/src/app/crash/backtrace.tsx index af89b9ac..fca85a71 100644 --- a/website/agb/src/app/crash/backtrace.tsx +++ b/website/agb/src/app/crash/backtrace.tsx @@ -1,6 +1,6 @@ "use client"; -import { useState } from "react"; +import { useEffect, useState } from "react"; import { ContentBlock } from "../contentBlock"; import { GameDeveloperSummary } from "./gameDeveloperSummary"; @@ -8,7 +8,10 @@ import { styled } from "styled-components"; import { Debug } from "./debug"; export function BacktracePage() { - const [backtrace, setBacktrace] = useState(getBacktrace); + const [backtrace, setBacktrace] = useState(""); + useEffect(() => { + setBacktrace(getBacktrace()); + }, []); return (