Hidden function responsible for error
Hey,
How can I make this code more robust:
The above code sometimes gives an error:
Typed property Filament\Forms\Components\Component::$container must not be accessed before initialization
However when i comment out the hidden. It works
Can I make the Closure more robust to fix this ?Solution:Jump to solution
I 'solved' this by wrapping it in a try catch and when in the cath, always return false
4 Replies
Bumping this. Anyone?
I don't know what data you exactly need from a parent form, but maybe you can better use livewire sth like this:
->hidden(function(Component $livewire) {
return $livewire->data['sent_field'];
})
I need to know the status from the order in order to decide if the field should be visible
I also tried this solution:
But this also gives me this error:
Typed property Filament\Forms\Components\Component::$container must not be accessed before initialization
Solution
I 'solved' this by wrapping it in a try catch and when in the cath, always return false