Closed kusiormarcin closed 4 months ago
Hi there,
Thanks for reporting but it looks like this is a question which can be asked on a support channel. Please only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use functionality provided by this repo you can try one of the following channels:
However, this issue will not be locked and everyone is still free to discuss solutions to your problem!
Thanks.
Hi
Issue: Can't provide empty object to the view. It's automatically converted to array. When I use useForm() and provide a prop (data from PHP) to the function, it creates const for every property.
The issue here is that I have a complicated form with multiple objects inside.
Some objects are empty while creating the resource, this is a normal behavior, because there is no data. These objects are initialized as arrays, and then they accept properties for whatever reason. But they are presented as an array.
When the form is sent, data is visible as incorrect array and PHP is getting empty array.
JS:
PHP:
The only workaround I found is to provide a PHP array with any named index, example:
Then it's correctly recognized as Object instead of array.
Any tricks like this doesn't work:
Is there any way to resolve this without workarounds?