8000 GitHub - nikgraf/react-reduce-stress: The name says it all
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

nikgraf/react-reduce-stress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-reduce-stress

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.

Screenshot of the console showing the hint

Install

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>
);

Supress Console Warnings/Errors usage

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.

Screenshot of an empty Chrome console

Roadmap

If you have warning that really annoyes you, please open a pull-request and we will add it to the list.

About

The name says it all

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0