I have an isomorphic React App.

I'm trying to wrap my head around when to load the state.

Do I need to do 2 different loads, one for server-side rendering and then another if a page is switched client-side?

I'm using webpack and Asp.net VNext with this setup:


Server-side rendering works great and I have everything set up. The React router works great.

Now if I go straight to a page like /users then I can easily load the model into state and render using server-side.

But obviously that won't work for client-side when I navigate to the page.

So do I have to keep 2 loading setups, one for server and one for client? Or should I always render the layout server side and use data fetching client side to load the data? (this seems like it would be shunning a big benefit of using server-side in the first place)

Is there a best practice for this?

Related posts

Recent Viewed