React comes with a lot of useful console logs and errors, but the ONE is missing. This package informs you when React.StrictMode is active and React will unmount and remount every component, whenever a component mounts for the first time.
yarn add react-reduce-stress
import { ReduceStress } from "react-reduce-stress";
// just place it anywhere inside <React.StrictMode>
root.render(
<React.StrictMode>
<ReduceStress />
<App />
</React.StrictMode>
);
supressConsoleWarnings({
hooksOrder: ["NavigationHeader"], // hide warnings for hooks order for the NavigationHeader component
uniqueKeyInList: ["AvatarGroup"], // hide warnings for unique key in list for the AvatarGroup component
useNativeDriver: true, // hide warnings for useNativeDriver (React Native)
setNativeProps: true, // hide warnings for setNativeProps (React Native)
});
Outcome: A peaceful Console at your discression for debugging.
If you have warning that really annoyes you, please open a pull-request and we will add it to the list.