3 ms·
I'm not sure what you're asking. "View source" will only show you the "source" text of the HTML page as the server sent it to you. Since this page is built with
by Arnavion 9y ago
I'm not sure what you're asking. "View source" will only show you the "source" text of the HTML page as the server sent it to you. Since this page is built with React without server-side rendering, said source just contains an empty div where the content would go (the one with id="root").
If you mean you want to see the DOM tree that has been generated with JS after you've loaded the page, you can see it in the corresponding tab in your browser's devtools. Eg in Chrome that's the "Elements" tab.
If you mean you want to know how the page works when you're offline, the information is again in the JS. You can use your browser's devtools to prettify it (both Chrome and FF have this feature) and search for "Do you want to be productive?" to see the code.
The Service Worker is only involved in that it returns the page and JS from its cache. It's the JS that detects whether it's offline or online and renders different content on the page accordingly. [1]
[1]: https://github.com/chrisbolin/react-detect-offline https://github.com/chrisbolin/react-detect-offline
- japhyr 9y agoThat's really helpful, thank you. I have no real understanding of how React works, and your explanation helps me know what to look for.