Replies: 1 comment
-
|
Got it working by double checking <Deferred data="songs" fallback={<div>Loading...</div>}>
{songs && songs.map((song) => (
//etc
``` |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What is the right way to use laravel-data with Inertias V2 Deferred props?
When I do:
songs' => Inertia::defer(fn () => SongData::collect(Songs::all()),The data is available in the front end, but I'm unable to loop over it.
I'm using React and it says that
mapis undefined.When I return the plain results like
songs' => Inertia::defer(fn () => Songs::all()),The Deferred props works like a charm, and I can loop over the results.
Beta Was this translation helpful? Give feedback.
All reactions