In this lesson, you will learn how to use the SafeAreaView component to avoid the sensor cluster (the notch) and home activity indicator on the iPhone X. SafeAreaView is similar to the View, just for iphone X, the screen is different from previous ve…
In this lesson we'll create a protected route just for logged in users. We'll combine a Route with a render prop and use a loggedIn prop to determine if the route should be allowed to be accessed. Finally we'll use nav state to preserve the location…
Let's take a look at the basics of using React Native's Image component, as well as adding some reusable styling to our Dashboard component buttons. We are going to build Dashboard Component, it will looks like this: Basicly have one image component…
In this lesson we will use Animated.spring and TouchableWithoutFeedback to animate the scale of a button in our React Native application. We will use the scale transform property and see how adjusting the friction of a spring will effect the spring a…
We have a render prop based class component that allows us to make a GraphQL request with a given query string and variables and uses a GitHub graphql client that is in React context to make the request. Let's refactor this to a function component th…
前言 先说说 shouldComponentUpdate 提起React.PureComponent,我们还要从一个生命周期函数 shouldComponentUpdate 说起,从函数名字我们就能看出来,这个函数是用来控制组件是否应该被更新的. React.PureComponent 通过prop和state的浅对比来实现shouldComponentUpate(). 简单来说,这个生命周期函数返回一个布尔值. 如果返回true,那么当props或state改变的时候进行更新: 如果返回fal…
A new Higher Order Component (HOC) was recently released in React v16.6.0 called React.memo. This behavior of the HOC is similar to what you’d get when using React.PureComponent or shouldComponentUpdate in a React Class Component. However, now with t…
React Native v0.4 发布,自从 React Native 开源以来,包括超过 12.5k stars,1000 commits,500 issues,380 pull requests 和 100 贡献者,还有 35 款插件 和 1 个 AppStore 应用! 直击现场 <HTML开发MacOSApp教程>  http://pan.baidu.com/s/1jG1Q58M 此版本主要改进如下: 错误信息和文档:添加了大量的警告信息,更新了文档,修复了大量的 bug 兼容 NP…
一 结论 React.Component 是没有做任何渲染优化的,但凡调用this.setState 就会执行render的刷新操作. React.PureComponent 是继承自Component,并且对重写了shouldComponentUpdate周期函数,对 state 和 props 做了浅层比较,当state 和 props 均没有改变时候,不会render,仅可以用在ClassComponent中 React.memo 功能同React.PureComponent,但React…
因为工作需要,需要进一步了解移动端的开发,遂返回复习移动端的知识点,在开始学习之前,产生了疑惑WEB APP .Native APP .Hybrid APP.React Native.Uniapp.H5这些东西到底是什么?感觉是那么熟悉,单词拆分开每一个都认识,但是合在一起就完全不知道什么意思了,遂自行百度查询,自己解自己的惑吧. 个人博客,理解不具权威性. 一.WEB APP 通俗的理解,WEB APP 即为使用HTML.CSS.JS三大前端基础进行开发的WEB APP,是基于浏览器进行运行使…