It is well known that using react native is a cross-platform Android and iOS App that can be developed. We can use react native to develop Android apps and develop iOS apps, so how do we develop the react native apps that fit both Android and iOS
Previously, the react component was created by inheriting React.component. The can also construct react components through stateless functional functions. Example
react components
Const Foodlist = ({items}) =>
Today put react native environment to complete, and then run a small demo to try.First Environmental configuration & Hello World Summary
According to the above study article, I basically completed, but in the configuration process encountered 2
A react native iOS app streamlines records from the start to the on-line process.
Develop your computer for Mac, so the following commands correspond to actions under Mac.
First open the official Getting Started documentation and configure the
1.react Data flow and communication between components
React is a top-down, one-way data stream, passed from the parent node to the child node (via props), and react re-renders all the child nodes if the top-level props changes.
Props: Used for the
First, in the React Native Flexbox has
Flex:1 its child elements have the same length
Justifycontent Vertical Layout
Alignitems Horizontal Layout
Flexdirction row (Landscape) Colum (portrait) Overall direction
Justifycontent (The relationship
· Pit 1: Route
After upgrading React-dom to 16.0.0, the corresponding router has been upgraded to more than 4.0. Previous routing settings were invalidated.
Past:
Nesting is not allowed at this time.
now the
Mobile apps are often limited by the size of the screen, and the uncertainty of the length of data content requires a list component as a container for data presentation in many places.
Corresponds to the native application component, which may be
Install required software HomebrewHomebrew, a Package manager for Mac Systems, is used to install Nodejs and some other required tool software./usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"Homebrew
React drag-and-drop sorting. It is used in the project, remember a pen. No use of REACT-DND, no use of REACT-BEAUTIFUL-DND, because the requirements are simple, so they have a.The code is simple.Defining a CSS, two animations. drag-up {
In the WIN10 environment, the Genymotion simulator is used to configure the react-native environment.First, install the JDKTo download the JDK online, the best version is more than 1.8. Configure the environment variables after installation.Also
React-native-page-scrollviewFor the ScrollView package, it is easy to achieve horizontal, vertical paging effect. And you can customize the page width height, and side view rotation, transparency, size and so on.The native ScrollView only supports
The project often uses some third-party components, each time the use of the Internet to find a lot, some good, some do not work,Now keep track of the components that you've used in your project, and save a bit of time to test and explore for
The transfer form of function parameters in JS is simpleFunction Show (s) {Console.log (s);}Show (' Hello '); It will output hello.Bind is required for the transfer of function parameters in react JSXHere is an example that can be used as a
In the development process, images are used in almost every project.RN is the display of pictures through the image component. You can load a network picture or load a local resource picture.The image component must declare the paragraph and height
OverviewThe so-called life cycle, which is the state that an object undergoes from its inception to the last extinction, understands the life cycle of the space and is a knowledge point that must be mastered in the development. Just like components
Life is not right and wrong, only after the choice of persistence, do not regret, go down, is right.
React Native Project Directory Resolution
In the previous section we simply built a new react native project Awsoneproject, and
ObjectiveA few days ago, Facebook launched the React Native (video link) at the React.js Conf 2015 conference. I sent a micro-blog (address), resulting in more than 100 forwards. Why is React Native attracted so much attention? I'm here to talk
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service