leewinter / type-scaf

Scaffold components from types
MIT License
2 stars 0 forks source link

Storybook default values #6

Closed leewinter closed 2 weeks ago

leewinter commented 2 weeks ago

Describe the bug Default values in stories sometimes set state to null even when the property is marked as required.

To Reproduce Steps to reproduce the behavior:

  1. Run Storybook after scaffolding stories from the default types
  2. Click on on the generated OrderForm
  3. Open console
  4. See error "Warning: Failed prop type: The prop defaultValues.customer is marked as required in OrderForm, but its value is null."

Expected behavior Don't expect to see this warning on first load of the form.

Screenshots NA

Desktop (please complete the following information):

Additional context Storybook options args have example data so may just be a template issue needing to select one by default?

leewinter commented 2 weeks ago

Resolved in this PR https://github.com/leewinter/type-scaf/pull/9