Writing of objects to local storage broken in 0.1.6 w/ Blazor 0.7.0
See original GitHub issueSince upgrading to Blazor 0.6.0 to 0.7.0 and from Storage 0.1.5 to 0.1.6, Writing objects directly to local storage seems broken.
i.e. Doing this:
storage.SetItem($"MyAppName.{nameof(MyClassName).ToLower()}", myClassInstance);
in 0.1.5 resulted in something like { \"Id\": 1337 }
being saved to storage, where as in 0.1.6 it only writes [object Object]
instead.
Downgrading back to 0.1.5 (but still with Blazor 0.7.0) works as expected.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
[Blazor] localStorage.getItem errors with complex objects
I created a fairly complex object that I want to store in local storage. The object gets set in local storage, but when...
Read more >How do I read and write to the local storage in Blazor ...
Figured it out. I needed to add it to the OnInitializedAsync() method so everything gets set before the DOM loads.
Read more >ASP.NET Core Blazor state management
This article describes common approaches for maintaining a user's data (state) while they use an app and across browser sessions. Blazor ...
Read more >LocalStorage with .NET 6 Blazor WebAssembly - YouTube
Blazor E-Commerce Course: https://www.udemy.com/course/ blazor -ecommerce/?couponCode=YOUTUBE Newsletter: ...
Read more >Use LocalStorage with Blazor WebAssembly .NET 7 - YouTube
One way to have data persist across sessions in a client-side Blazor WebAssembly application is to write to the browser's LocalStorage or ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@galvesribeiro Confirmed working fine in 0.1.8 + 3.0 preview.5 - Closed.
I have yet to update my apps for preview4; It’s proving harder than the previous ones. I’ll try to get to it in the next day or two and report back.