Sometimes you may have a React component in your storybook that make calls to a backend API, and will not function properly if that API is unreachable.
Just as we mock backend API endpoints in unit tests for React components, we can do the same in React Storybook.
Here are some articles on how to do it in various ways:
msw (Mock Service Worker) addon:
- https://itnext.io/api-mocking-in-unit-test-and-storybook-a0e774f7296 (also covers two other options)