Using the DI pattern with storybooks

A storybook is a way to document your components. As your application grows, you may quickly end up with hundreds of components. If you build a serious application, most of them are aligned to a design specification and all of the expected features will have been implemented. The trick is knowing which props to send to achieve the expected result. Storybook makes this simple. When you implement a component, you also create a storybook for different scenarios. Check out the following trivial example for the Button component:

Example storybook of the Button component

By selecting scenarios in the left panel, ...

Get Hands-On Design Patterns with React Native now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.