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

Quick wins

When a new developer joins the project, it may be a little challenging for them to understand our code base. Let's address a few easy fixes.

To start with, where is the entry file for our application? It's in the root directory. However, there is no clear entry point in the source (src/) directory. This is okay, but it would be handy to have it close to the story and examples. At a glance, you will have examples, the storybook, and the app root to lookup.

In addition, we can refactor the current ScreenRoot component. It serves as AppRoot and is wrapped in two HOCs. As you already know, such coupling is not a good thing. I have made a little refactor. Have a look at the new structure:

The entry point to the application is now clearly ...

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