react-inspector icon indicating copy to clipboard operation
react-inspector copied to clipboard

Hiding nodes based on name?

Open alvaro1728 opened this issue 3 years ago • 1 comments

I'd like to hide certain nodes based on their name. Is that possible without modifying the original object? For example:

  const onNodeRender = useCallback(({name, data, isNonenumerable}) => {
    if (name === "hideMe") {
       // return something that hides this node; null doesn't work -- it just shows an empty row. 
    } 
    return <ObjectLabel name={name} data={data} isNonenumerable={isNonenumerable} />;
  }, []);

Thanks, Alvaro

alvaro1728 avatar Apr 15 '21 01:04 alvaro1728

You can checkout fork that I made - https://github.com/Artboomy/react-inspector/tree/dev/feature%2Fhighlight It has highlight and search functionality. Look for HighlightContext & SearchContext.

Disclaimer: It does modify input object by adding non-iterable symbol fields on original object.

Artboomy avatar Jun 07 '21 11:06 Artboomy