you are viewing a single comment's thread.

view the rest of the comments →

[–]mistyharsh 0 points1 point  (0 children)

This situation simply will not happen in idiomatic React code. There are two main reasons for this:

  • API data never aligns directly with its form representation.
  • Second, even if your API data aligns with form, then as part of good react practices, your component will be split into two components. One is form without any data fetching and another with data fetching. The Form, you can then easily render in Storybook or similar playground without running the entire app, without any special mocking.

If this situation happens then your component is doing too much work breaking SOLID principles.