Pridgey
Using FLIP Move with createServerData
I'm building a page that displays ranked results users can vote on. I pull the data from the routeData using
createServerData
. From there, I listen to a websocket to know when another user has made a change, and then refetch the routeData using refetchRouteData()
.
I feed the results of the route data into a different component that displays the results in order of rank. In this Results component I wrap the list in a <TransitionGroup>
component from solid-flip. This animates nicely when new records are added and removed, but doesn't animate them nicely if they are rearranged. Instead I just get a sudden re-rendering of the results. I'm hoping to understand why the reordering animation doesn't work. I'm not sure if it's an issue with how I have it setup, or if it is a result of the data coming from createServerData
. Any insight would be very helpful.
Thank you very much7 replies
Subscribe to data in solid-start
I'm using Supabase with solid-start. I'm pulling data from the postgres db using
createServerData$
function. I'm hoping to have this page subscribe to the data and update if another user inserts data to the postgres table.
Are there any patterns to handle this using solid-start? I'm not sure how to subscribe in an SSR setting.8 replies
How to make a global layout?
I'd like to make a single layout for all of my pages within the route structure, but I'm not quite sure how to do this.
If I make a
routes/(root).tsx
file, then the /
path shows up as that html & css, but nothing from routes/index.tsx
populates the <Outlet />
. And if I navigate to /login
then the html & css from the layout doesn't appear at all.
So I'm not sure what it should be instead.5 replies
Getting User Info from route page
I might be fundamentally misunderstanding how this is supposed to work, so if that is the case please let me know.
I'm authenticating with Supabase via the /signin route, which stores the jwt in a cookie.
Now, when I load up index.tsx I'm hoping to get the User data to render on the page. Something simple like a "Hello {Username}".
Here is what my index.tsx looks like:
getUser()
works as expected and retrieves the user's information. The console.log in routeData() displays user data. Hooray.
How do I get that same data into the component? useRouteData
doesn't seem to have it, and the console.log("Render:"...
seems to be happening well before the routeData()
function has finished.
This is where I think there's a gap in my understanding of how this works. So any insight would be incredible.
Thank you all,28 replies