O'Reilly logo

Hands-On Design Patterns with React Native by Mateusz Grzesiukiewicz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required