官术网_书友最值得收藏!

React Component Patterns

Developing Android and iOS has never been easier than it is now. React Native has changed how fast we develop new apps and deliver value to the end user. Knowing this technology will give you a great edge in the market. I'm Matt and I'm happy to show you the best practices I have learned while working in a React Native ecosystem. Through this book, we will explore design patterns by example. In just this first chapter, we will create over 10 small applications. Later on in this book, we will create more complex applications, using the patterns that I will gradually introduce to you.

In this chapter, we will explore React patterns that also apply to the React Native world. The most crucial patterns you need to understand are stateless and stateful components. Understanding how to use these will make you a much better React Native developer and empower you with standard patterns in every React Native application.

When it comes to components, it is crucial to make them as reusable as possible and follow the well-known programmer principle—Don't Repeat Yourself (DRY). Presentational components and container components are meant to do just that. We will dive into them with a couple of examples to learn how to split features into reusable pieces.

To be more precise, in this first chapter, we will look at the following topics:

  • Stateless and stateful components, using short and then more complex examples
  • How to create reusable and easily configurable presentational components 
  • Container components and their role in the encapsulation of features
  • When to compose components and how to create Higher Order Components (HOCs)

It's time to act on your side. Prepare your environment for React Native development right now if you want to follow along and play with the examples. Most of the code samples that you will see in this book can be run and displayed either on a simulator or on a real mobile device. Now, make sure that you can launch the Hello World example on your mobile or simulator.

Code examples are checked into a Git repository on GitHub, which can be found at  https://github.com/Ajdija/hands-on-design-patterns-with-react-native.
Please follow the readme.md instructions to set up your machine and launch our first example. The Hello World example can be found in the following directory  src/Chapter_1_React_component_patterns/Example_1_Hello_World.
主站蜘蛛池模板: 托克托县| 沙河市| 肃北| 北海市| 贵州省| 新干县| 大姚县| 宁蒗| 嵊泗县| 石屏县| 天柱县| 门头沟区| 安岳县| 阳原县| 岑巩县| 文化| 孝感市| 沛县| 彭阳县| 永定县| 卓资县| 乐清市| 犍为县| 马公市| 获嘉县| 商洛市| 津南区| 综艺| 贵港市| 云梦县| 盘锦市| 浮山县| 青川县| 四会市| 东方市| 胶州市| 尤溪县| 宿迁市| 赤城县| 万宁市| 五华县|