We've shared a react project (http://www.jb51.net/article/76085.htm), which has made some improvements to the project, adding REM layouts and Iscroll optimizations on Android.
Project code, Welcome to fork and Star, online preview
REM Layout
React native how to achieve cross-platform
React native is implemented across platforms through virtual DOM, runtime
Converts the virtual DOM to the appropriate Web encoding, Android number, and iOS encoding.
Code implementation:
01.html:
ListView Property
name
type
meaning
Default Value
DataSource
Listviewdatasource
Data set
No
Initiallistsize
Number
Set the number of elements initialized on the first page
Jest Installation
Install the jest command line by using the command NPM installation jest-cli--save-dev:
Localhost:testerhome wuxian$ npm Install jest-cli--save-dev jest-cli@0.7.1 node_modules/jest-cli├──jasmine-pit@2.0.2
This question must be met by a lot of people, here I say how to get the parameters in the URL.
Get the values in Purchaseorderno as shown in the figure.
This time we need to use one thing:
' Querystring.parse (_this.props.location.search) '
The 1.render should be a pure function, meaning that each time the same input is given, the same output should be returned, and there should be no behavior that modifies the state or interaction, which is passed on to the logic.
2. Components
This site article is Li Himi original, reproduced must be clearly noted:
Reprinted from "Black Rice gamedev Block" original link: http://www.himigame.com/react-native/2242.html
The development of the game should be very clear, "brush screen" is
React not like angular's $resource or $http, or jquery's $ajax-like network request library, the network request is the author's own encapsulation, of course, you can also adapt according to their own needs.
The main content is get,post,jsonp and
Architecture and SpecificationsWhat does the architecture do to solve the problem? I understand the problem of efficiency. With a good architecture, you can easily and consistently understand a system, based on which business functions can be
(The following section is in the translation, please wait ... ) would automagically hook up inputs to formik. It uses the name attribute to match up with Formik state. Would default to an element. To change the underlying element of Specify a
SetStateParameters: Nextstate (object), [Callback (function)]Sets a key value for the nextstate. Usually if you want to re-render the component in an event or a callback, SetState is the most common trigger method because we bind the UI content
React.createclassParameters: Config (object)Create a Reactclass (component Class), the parameter is an object and must have a render property method, the method must return a closed container (within the container can be used by other open-ended
TextInputis an underlying component that allows the user to enter text. It has a property named onChangeText , which accepts a function that is called when the text changes. There is also a property named onSubmitEditing , which is called after the
One, react components1. Parent-Child ComponentsReact organizes apps by combining rather than inheriting. An application starts from a component and creates other components in the component, and all the components eventually form a tree-like
ScrollViewis a generic scrollable container where you can put multiple components and views, and these components do not need to be of the same type. ScrollView not only scrolls vertically, but also scrolls horizontally ( horizontal set by
Beginners may be full of expectations for react, feel that react may have blown up all other frameworks, and even unrealistic to think that react may even be able to explode the original rendering-the enthusiasm for the framework will indeed appear
Only the students who are concerned with the problem in parentheses can jump directly to the Blue Word section. (the title is a bit big, in fact only one question is discussed)Two events bound on the React component, after a conflict, using
Transferred from: Http://www.tuicool.com/articles/Ar6ZruqReact itself is very concerned about performance, the virtual DOM provided with the diff algorithm, to achieve the minimum granularity of DOM operation change is also very efficient. However,
Origin1. React does not generate DOM from HTML fragments of type string2. Calling SetState () in componentwillreceiveprops does not trigger Re-render3. This.setstate () cannot be called in Componentwillupdate4, before the acquisition of data through
REACT provides a life cycle hook function for each component TI to respond to different moments-the period of creation and the period of destruction.Instantiation Period:When you first use a groupItem Class:This method is not called when
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.