DEV Community

Cover image for Trick for React Debugging
Isaque Igor
Isaque Igor

Posted on

2

Trick for React Debugging

Do you want to see what's actually coming in from the props?

The JSON.stringify() creates a JSON string out of the props and you will see everything that's coming in from the routes.

Alt Text

The third argument of JSON.stringify(data, replacer, space) is the number of spaces to use for pretty formatting. That means, if you set 4 as your space parameter, the result would be more indented.

You will see something like this, on your page:

{
  "name": "Isaque Igor",
  "id": 1,
  "email" : "email@email.com",
  "roles": {
      "isDeveloper": true,
      "isAdmin": true
  }
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay