`Typed property Filament...Component::$container must not be accessed before init` from custom field
I have a custom field that I am calling from within the form scheme of a panel. Inside it I have cave a computed property that returns some inputs, I would like to make use of filament's form components though, to keep everything more consistent. If however I do so, I am greeted with the following error: Typed property Filament\Forms\Components\Component::$container must not be accessed before initialization
The code that produces the output is this:
It is called within a blade component that looks like this:
Is there a way to perhaps block this until the child components are ready? I tried adding a flag and waiting for
afterStateHydrated
, but it did not help1 Reply
So apparently the solution was to create a
public function getChildComponents(): array
and put the array of components in there, changing the blade component to:
I must note that I could not find anything related to this in the documentation