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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.