diff --git a/packages/graphiql/src/GraphiQL.tsx b/packages/graphiql/src/GraphiQL.tsx index f57a961d4a..4927bc9408 100644 --- a/packages/graphiql/src/GraphiQL.tsx +++ b/packages/graphiql/src/GraphiQL.tsx @@ -373,7 +373,10 @@ export function GraphiQLInterface(props: GraphiQLInterfaceProps) { const handleClearData = () => { try { - storageContext?.clear(); + // Optional chaining inside try-catch isn't supported yet by react-compiler + if (storageContext) { + storageContext.clear(); + } setClearStorageStatus('success'); } catch { setClearStorageStatus('error');