Open james2hey opened 1 year ago
I just experience this issue, trying to set a simple user object like : { id: 2, name: 'KeitelDOG', image: '' }
. And it automatically send an empty object {}
, while the Typescript type User is uses for this props. I don't have to check the Props since that's what Typescript or PropTypes are there for.
Describe the bug
When a component has an optional object prop and it is set as an undefined arg, when trying to define the object keys, an empty object is automatically set as the arg value.
This causes issues for components which have required entries that couldn't be defined, as clicking "Set object" will set the arg to
{}
before any required entries could be defined.To Reproduce
https://63f4f662ea2e878c745e00db-sfsgqnpqra.chromatic.com/?path=/docs/example-introduction--docs
System
Additional context
A longer term fix for this could be improved controls support for TS interfaces. In the short term, the
{}
just probably should not be set until the user has hit the enter key.