Is this a Pinia bug? #1191
Replies: 3 comments 11 replies
-
Beta Was this translation helpful? Give feedback.
-
I spent some more time debugging this issue and I found that the issue exists even when the data properties are placed inside a normal vue component data properties. I tried a JSON.stringify on the data array and I get an empty array so that tells me something is wrong with my objects, oddly enough, using vue dev tools, all the data properties show up as you would expect they just don't render properly in the DOM (unless you navigate/force a redraw). Still trying to isolate what's wrong with my simple json objects. |
Beta Was this translation helpful? Give feedback.
-
@jdheeter - when pulling data from the store, you must wrap it in a computed. This is what triggers the component re-render. For example You don't quite show that bit in your code, but I suspect that is the issue. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-

I'm trying to render a reactive object in my pinia store to the DOM. It seems like the data has lost reactivity because when I navigate away from the tab and back (redraw the component) then the data becoms available. When I reload the data via fetch then the data in the DOM becomes an empty array again.After navigating away and back

Clicking load again:

As you can see in the devtools, the array has 5 objects in it, so why is an empty array being rendered?
Here is the vue component:



atomic.getAccountAssets() simply loads data into that array under the 'upliftevents' key
Beta Was this translation helpful? Give feedback.
All reactions