aspnet / Templating

[Archived] ASP.NET Core templates for .NET CLI and Visual Studio. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
205 stars 79 forks source link

question about window.initialReduxState #411

Closed mathysd closed 6 years ago

mathysd commented 6 years ago

The reactredux template creates an index.js file containing:

// Get the application-wide store instance, prepopulating with state from the server where available. const initialState = window.initialReduxState; const store = configureStore(history, initialState);

What options do I have to initialize this initial state?

tpetrina commented 6 years ago

If I remember correctly, you need to utilise asp-prerender tag to create that object. It is used by server side rendering.

Eilon commented 6 years ago

@tpetrina maybe you meant asp-prerender tag? But asp-pretender tag sounds cool too 😄

mathysd commented 6 years ago

Thanks, I will have a look