Replies: 2 comments 7 replies
-
I'm glad it helped, that was the point of this repository! 🙂 Speaking about forms, I'd rather go with Blade components as nested ones. Because when you pass variables downstairs to Livewire components, it performs heavy mapping on data (speaking in the context of milliseconds of course). For a spinner, I'd go to check the defer loading feature. It should be easy: you put some spinner icon when the page loads, and then make it hidden using |
Beta Was this translation helpful? Give feedback.
-
I feel like someone should write an ebook on how to use Livewire in real world scenarios. It’s definitely missing! 😉 Thank you for your answer. I like the idea of using Blade components but let me ask you this: a good thing when using nested Livewire components is that they are not re-rendered all the times when the parent refreshes, so you can re-render them only when needed. Wouldn’t this be more optimal so the requests are kept small? If you use Blade components, everything is re-rendered all the times. For the spinner, this is what I’ve done so far but I do feel like there’s a best and cleaner way and maybe you can see something I don’t:
As I said earlier, this feels a bit messy. |
Beta Was this translation helpful? Give feedback.
-
Hi @michael-rubel, thank you very much, this repository is amazing and that's what missing on the web when it comes to Livewire!
When building complex forms, do you think it's usually better to split single parts of the form into different nested Livewire components (especially when they have some logic built-in, for example, the ability to upload an image, etc.) or the whole state should be inside the main component that handles the form?
Also, it would be great if you could write some best practices to show a loading spinner/state BEFORE the Livewire component initializes the data on the page. I find myself doing this very often and I feel like it can be done more in a more clean way.
Thanks again!
Beta Was this translation helpful? Give feedback.
All reactions