question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warning: Can't perform a React state update on an unmounted component

See original GitHub issue

I am using GraphiQL in the form as a textarea field and every time I hit submit and navigate away from the page I get this warning

Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method. in GraphiQL (created by GraphQlTextArea)

Can someone please look into this?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:50 (31 by maintainers)

github_iconTop GitHub Comments

3reactions
sashahaviacommented, Jun 3, 2020

@sashahavia we released another alpha today that should take care of this, by avoiding fetch requests during re-renders. graphiql@1.0.0-alpha.11 should be the one you want

let me know if that helps! if not, we will try the other fix as well.

@acao Getting this error when trying to run the app:

ERROR in ./node_modules/graphql-language-service-interface/esm/getAutocompleteSuggestions.js 35:51
Module parse failed: Unexpected token (35:51)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|                 label: argDef.name,
|                 detail: String(argDef.type),
>                 documentation: argDef.description ?? undefined,
|                 kind: CompletionItemKind.Variable,
|             })));
 @ ./node_modules/graphql-language-service-interface/esm/index.js 2:0-45 2:0-45
 @ ./node_modules/codemirror-graphql/hint.js
 @ ./node_modules/graphiql/esm/components/QueryEditor.js
 @ ./node_modules/graphiql/esm/components/GraphiQL.js
 @ ./node_modules/graphiql/esm/index.js
2reactions
sashahaviacommented, Jun 15, 2020

@acao I have updated to 1.0.0 release and still got this error

react_devtools_backend.js:6 Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't perform a React state update on an unmounted ...
Here is a simple solution for this. This warning is due to when we do some fetch request while that request ...
Read more >
Can't perform a react state update on an unmounted component
To solve the "Warning: Can't perform a React state update on an unmounted component", declare an isMounted boolean in your useEffect hook that...
Read more >
React: Prevent state updates on unmounted components
Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your...
Read more >
Can't perform a React state update on an unmounted ... - GitHub
Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your...
Read more >
React prevent state updates on unmounted components
Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found