score:0

this is something you could do in your router on the server. you can't do it in your react app, because that defeats the purpose of having js-less content to serve (since you'd be using js to deliver the "static" content).

if you don't have a server set up yet with a router, that will take some time. but once you do, a simple check in the route will suffice.

// in hapijs, for example:

handler(request, reply) {
   if (isauthenticated(request)) {
     reply.view('dashboard')
   } else {
     reply.view('static_page')
   }
}

Related Query

More Query from same tag