Skip to content

Commit

Permalink
found case which was not optimized
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaMachina committed Dec 14, 2024
1 parent 8410fed commit d89dc49
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/graphiql/src/GraphiQL.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit d89dc49

Please sign in to comment.