Is there anyway to view the react source code of websites built with React?
If you inspect the source code of a react page you will only see the root div. Is there a way to see the actual components?
Is there anyway to view the react source code of websites built with React?
If you inspect the source code of a react page you will only see the root div. Is there a way to see the actual components?
It depends on the existence of source map files to see the actual source code. (otherwise, you just can read the Transpiled/Vague source code)
quoted from MDN:
A source map is a file that maps from the transformed source to the original source, enabling the browser to reconstruct the original source and present the reconstructed original in the debugger.
In default mode, CRA will create a source map for each generated js file, so by using it you can read the actual source code in the developer tools.
NOTE: there is a tool called unwebpack-sourcemap to recovering the uncompiled TypeScript sources, JSX, and more from Webpack sourcemaps which you can use.