I use React DevTools Chrome Extension. I want to append component filters from a react app code. Is there a way to do this?
In common I want to share default application DevTools settings across the app developers.
I use React DevTools Chrome Extension. I want to append component filters from a react app code. Is there a way to do this?
In common I want to share default application DevTools settings across the app developers.
I figured out. Here's an example:
if (__REACT_DEVTOOLS_GLOBAL_HOOK__) {
const handleReactDevtools = (agent) => {
__REACT_DEVTOOLS_COMPONENT_FILTERS__.push({
type: 2,
isEnabled: true,
isValid: true,
value: "HideMe"
});
agent.updateComponentFilters(__REACT_DEVTOOLS_COMPONENT_FILTERS__);
};
if (__REACT_DEVTOOLS_GLOBAL_HOOK__.reactDevtoolsAgent) {
handleReactDevtools(__REACT_DEVTOOLS_GLOBAL_HOOK__.reactDevtoolsAgent);
} else {
__REACT_DEVTOOLS_GLOBAL_HOOK__.on("react-devtools", handleReactDevtools);
}
}