F
Filament12mo ago
Arnaud

Hide form loose state

I have a livewire component who own many sub components. If I do something like that :
@if($step === 2)
<div>
<livewire:sub-component />
</div>
@endif
@if($step === 2)
<div>
<livewire:sub-component />
</div>
@endif
Every time I change step, I will get many error messages in console :
Uncaught ReferenceError: state is not defined
Uncaught ReferenceError: state is not defined
Any idea how to completely hide from page a form and reshow it without problem ?
Solution:
You can't do that since the state wouldn't be there as livewire puts the states into the application on boot/mount. How big is the form? could you load it but hide it so livewire is aware but it's hidden?
Jump to solution
2 Replies
Solution
toeknee
toeknee12mo ago
You can't do that since the state wouldn't be there as livewire puts the states into the application on boot/mount. How big is the form? could you load it but hide it so livewire is aware but it's hidden?
Arnaud
ArnaudOP12mo ago
Thank you for your feedback. I will try to simply hide it with css. Works well, no more errors ❤️ Have a nice day
Want results from more Discord servers?
Add your server