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

Every time I change step, I will get many error messages in console :
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?
Was this page helpful?