Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✅ throw an error when console.error() is called
Throw an error when `console.error()` is called. This is especially useful in a React tests because React uses it to show warnings and discourage you from shooting yourself in the foot. Here are a few example warnings React throws: - "Warning: useLayoutEffect does nothing on the server, because its effect cannot be encoded into the server renderer's output format. This will lead to a mismatch between the initial, non-hydrated UI and the intended UI. To avoid this, useLayoutEffect should only be used in components that render exclusively on the client. See https://reactjs.org/link/uselayouteffect-ssr for common fixes." - "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." - "Warning: Cannot update a component (`Component`) while rendering a different component (`Component`). To locate the bad setState() call inside `Component`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render"
- Loading branch information