Open Closed

PersistentComponentState is not working in Blazor server with ABP.IO #8460


User avatar
0
prachi@urvin.finance created
  • ABP Framework version: v8.3.0
  • UI Type: Blazor Server
  • Database System: EF Core (PostgreSQL)
  • Exception message and full stack trace: -

_host.cshtml file

I am experiencing an issue where PersistentComponentState is not functioning as expected in a Blazor Server project using ABP.IO. While the prerendering process works, my component renders twice because the state is not being retained properly.

Steps to reproduce the issue:

  1. Enable prerendering in a Blazor Server project.
  2. Attempt to use PersistentComponentState to retain component state across renders.
  3. Observe that the component renders twice, but the state is not persisted.

Expected behavior: The component should render once, and the state should be retained seamlessly using PersistentComponentState.

Please let me know if you need additional details or code samples to reproduce this issue.


5 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you share a new template project(including steps) to reproduce the problem? I will download and check it. You can share it by https://wetransfer.com/

    Thanks.

    liming.ma@volosoft.com

  • User Avatar
    0
    prachi@urvin.finance created

    I have sent it to you. Also here is the link to access it https://we.tl/t-F0ShSUymdY

    Thanks

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Your project is not a blazor web app style.

    Please check my project at: https://github.com/abpframework/abp/commit/edc226387b30adadac5debceb02810ca23caaabf

  • User Avatar
    0
    prachi@urvin.finance created

    Thanks for the response.

    I would like to inform you that I am able to use PersistentComponentState in dotnet blazor server tempate. but when I create a blazor server abp template it is not working.

    This is related to my project that is in abp blazor server based application that we recently update to dotnet 8

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Hi

    Your project should have App.razor and Routes.razor

    This is new blazer web app style components.

    Please check abo blazer project

    https://github.com/abpframework/abp/tree/dev/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server

    https://github.com/abpframework/abp/tree/dev/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Components

    https://github.com/abpframework/abp/commit/edc226387b30adadac5debceb02810ca23caaabf

Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09