Search code examples
asp.net-coreblazor.net-8.0

Blazor Web .net8 - what is the logic of placing components - should i put them in the main project or the Client project? how do i decide?


sorry if this has already been asked,i honestly spent some time looking for a comprehensive explanation of this but i have struggled so far.

with the new fancy idea of combining the powers of two worlds - the Server side and WebAssembly - and the introduction of InteractiveAuto mode - can someone please help me out with a comprehensive summary to these questions:

Where do i place a blazor component that is a routable page? and a component that is not a routable page? do i place it in the MAIN project or a CLIENT project? what aspects affect the decision?

thank you everyone for taking a moment for this.


Solution

  • Put all the components in the client project.
    Components in the server -- only work on websockets.
    Components in the client -- can work on both websockets and webassembly.
    If the "unroutable page" is a component of a "routable page" , it should be also placed in the client.