If I were to build a client side render site that has a user page and a admin page using React, does it make sense to have two separate HTMLs with separate bundle.js
or I should just have one HTML with one bundle.js
and have my script render the two pages/components conditionally? Why is one way better than the other way?
Two bundles:
One bundle:
Which is better depends on your needs. One thing to remember is that your site can be viewed through the dev console or other tools, so secret data needs to be sent only if the user is authenticated. It's up to your needs whether that means two sites or authenticated requests for data.