Skip to content

Instantly share code, notes, and snippets.

@majames
Created May 27, 2019 06:23
Show Gist options
  • Save majames/bb83d41307d36839a6ae838701f06bdd to your computer and use it in GitHub Desktop.
Save majames/bb83d41307d36839a6ae838701f06bdd to your computer and use it in GitHub Desktop.
react hooks and enzyme error
console.error ../../../node_modules/react-dom/cjs/react-dom.development.js:506
Warning: An update to QuickLook inside a test was not wrapped in act(...).
When testing, code that causes React state updates should be wrapped into act(...):
act(() => {
/* fire events that update state */
});
/* assert on the output */
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://fb.me/react-wrap-tests-with-act
in QuickLook
console.error ../../../node_modules/react-dom/cjs/react-dom.development.js:506
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 a useEffect cleanup function.
in QuickLook
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment