[LiveComponent] `onUpdated` hook is not called on `formValues`
I am using ComponentWithFormTrait and need to save submitted values (draft mode until full form submit).
So I though that overriding $formValues and adding a hook will work. But that's not the case 🤔
class Component {
// ...
#[LiveProp(writable: true, fieldName: 'getFormName()', onUpdated: 'formValuesUpdated')]
public array $formValues = [];
public function formValuesUpdated(): void
{
// never called
}
}
Is there a better way to hook for this?
PostHydrate ?
Thanks. it's a minus that I can't inject Request and need to interact with RequestStack..
But why onUpdated hook does not work here?
I believe props were not made for complex objects at first (as we should repeat these values are serialized and accessible entirely in the DOM
Hey, thanks for your report! There has not been a lot of activity here for a while. Is this bug still relevant? Have you managed to find a workaround?
Still think this should be considered