Melanie Sigrid
Melanie Sigrid

Reputation: 15

Is there a way to know which components are loading in React?

I have a very large React application that uses class components, with some API calls I need to change. The problem? When I make the change on one file, it still loads another file that is overriding the information I'm entering.

I want to find out which component is overriding the desired behavior.

Is there a way to log which components are being loaded?

Edit: I know React Developer Tools, I was looking for something more comprehensive that might catch something that doesn't appear there.

Upvotes: 0

Views: 1156

Answers (2)

user18821127
user18821127

Reputation: 366

I think the best would be to analyze the application top to bottom.

If it is a lot, then starting from routes or some top level component (you can comment it out and then look for errors)

Upvotes: 0

Daniel Sz
Daniel Sz

Reputation: 116

You can use the React Developer Tools Chrome extension to see the component tree React rendered. It also contains a profiler which helps you to see which component is rendered and why. It should give you a clear overview of the loaded components in your app.

Upvotes: 1

Related Questions