Hello!
I implemented a custom component to add some functionalities like adding CC emails to user data.
On a working MyCustomComponent I have a relationship multiselect which should be able to add new items.
` public function mount()
{
$this->user=auth()->user();
$this->userClass=get_class($this->user);
$this->form->model($this->user);
$this->form->fill($this->user->only($this->only));
}
public function form(Form $form): Form
{
return parent::form($form)
->statePath('data')
->schema([
Select::make("emails_ccs")
->label("E-Mails CC")
->relationship("emails_ccs", "email")
->getOptionLabelsUsing(fn(array $values):array=>$this->user->emails_ccs->pluck('email','id')->toArray())
->multiple()
->createOptionForm([
TextInput::make("email")
->required()
->email()
])
]);
}`

This works correctly but when clicking the "+" button an error is triggered: "Call to a member function isRelation() on null." and I'm not sure what's the problem.

I tried this solution #293 but the add button won't work at all.
Thanks for any help!
Hello!
I implemented a custom component to add some functionalities like adding CC emails to user data.
On a working MyCustomComponent I have a relationship multiselect which should be able to add new items.
` public function mount()
{
$this->user=auth()->user();
$this->userClass=get_class($this->user);
$this->form->model($this->user);
$this->form->fill($this->user->only($this->only));
}
This works correctly but when clicking the "+" button an error is triggered: "Call to a member function isRelation() on null." and I'm not sure what's the problem.
I tried this solution #293 but the add button won't work at all.
Thanks for any help!