leonbloy
leonbloy

Reputation: 75986

Explore components dependencies inside a React project

Is there some VsCode extension, tool or tip to get some graph or report of the internal dependencies of React components, inside a React project?

Specifically, suppose I have defined my component <MyComponent .../>; I wish to know which other components (always inside my project) include it as children, like <ParentComponent> ... <MyComponent .../> <ParentCOmponent> and, viceversa.

Upvotes: 0

Views: 775

Answers (1)

Ezra Siton
Ezra Siton

Reputation: 7781

1. GUI

One useful tool for outline the component tree -or- Debugging is the React Developer Tools chrome extension (Components tab).

Download here: https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en

Component tree Screenshot: enter image description here

Search: enter image description here

Related: https://reactjs.org/blog/2019/08/15/new-react-devtools.html

2. By code:

React.Children https://reactjs.org/docs/react-api.html#reactchildren

Upvotes: 1

Related Questions