SolidJSS
SolidJS2y ago
4 replies
jacobgoodwin

Possible to map of `useSubmissions` result?

I was just playing with solid-router, and was curious if there was a way to map over the results of useSubmissions outside of a rendered <For> component.

In the linked code: https://github.com/JacobSNGoodwin/scavenge-solid/blob/main/src/components/HuntItemsList.tsx#L43, I was trying to basically create a list of items where I optimistically filtered out any items being deleted and optimistically added any being added, while also sorting them.

I was able to get the ids of submissions being deleted in a good old fashioned for loop, but we cannot map over the Proxied array (which may be fine and desirable).

So this had me wondering if anyone has opinions on the best way to handle this sort of situation. I'm probably coming from the react world and not doing this right.
GitHub
A playground for managing scavenger hunts build with solid-start > 0.4 - JacobSNGoodwin/scavenge-solid
scavenge-solid/src/components/HuntItemsList.tsx at main · JacobSNGo...
Was this page helpful?