Debugging a complex React codebase
While debugging a large React code base the main challenge is where the code has been written. in some projects, they don’t follow any naming conventions for react files and it will become challenging to identify which file you have to modify.
Get Mohana S’s stories in your inbox
Join Medium for free to get updates from this writer.
Let's see how we can solve this challenge:
1. You need to install the bellow extensions.
2. Reproduce and identify the component causing the issue.
In my case, the table component is causing the issue, so by right-clicking on that table component I opened the inspect window.
3. Open the Component tab in the inspect window.
On Chrome dev tools (inspect) open the Component Tab, then select the nearest parent component.
In the bottom section, it has three parts props, rendered by and source.
- props show what and all props you have passed to that component.
- source shows the file name.
- rendered by shows the render tree.
Using the “rendered by” and “source” information we can know the component name and where it is located.
4a. Debugging the issue with VsCode:
Go to Vscode and search for the same component by clicking CTRL+P. and then try manually debugging.
4b. Debugging the issue with Chrome(Dev environment)
Open the “Source” tab and search for the component file by pressing CTRL+P
Keep debugger points on suspected lines and reload the page or do some interaction with the page it will automatically start the debugger.
If you found this article helpful please give a like and if you have any queries please ask in the comment section I am happy to help.
Every week I publish at least one article, please consider following and Subscribing to my EMAIL ✉️ list.
More content at PlainEnglish.io.
Sign up for our free weekly newsletter. Follow us on Twitter, LinkedIn, YouTube, and Discord.











