diff --git a/releases/next/docs/flexbox.html b/releases/next/docs/flexbox.html index 71cb9f43cb9..6d811cf93f5 100644 --- a/releases/next/docs/flexbox.html +++ b/releases/next/docs/flexbox.html @@ -14,7 +14,7 @@ class FlexDirectionBasics extends } }; -AppRegistry.registerComponent('AwesomeProject', () => FlexDirectionBasics);

Justify Content #

Adding justifyContent to a component's style determines the distribution of children along the primary axis. Should children be distributed at the start, the center, the end, or spaced evenly? Available options are flex-start, center, flex-end, space-around, and space-between.

import React, { Component } from 'react'; +AppRegistry.registerComponent('AwesomeProject', () => FlexDirectionBasics);

Justify Content #

Adding justifyContent to a component's style determines the distribution of children along the primary axis. Should children be distributed at the start, the center, the end, or spaced evenly? Available options are flex-start, center, flex-end, space-around, and space-between.

import React, { Component } from 'react'; import { AppRegistry, View } from 'react-native'; class JustifyContentBasics extends Component { @@ -35,7 +35,7 @@ class JustifyContentBasics extends } }; -AppRegistry.registerComponent('AwesomeProject', () => JustifyContentBasics);

Align Items #

Adding alignItems to a component's style determines the alignment of children along the secondary axis (if the primary axis is row, then the secondary is column, and vice versa). Should children be aligned at the start, the center, the end, or stretched to fill? Available options are flex-start, center, flex-end, and stretch.

For stretch to have an effect, children must not have a fixed dimension along the secondary axis. In the following example, setting alignItems: stretch does nothing until the width: 50 is removed from the children.

import React, { Component } from 'react'; +AppRegistry.registerComponent('AwesomeProject', () => JustifyContentBasics);

Align Items #

Adding alignItems to a component's style determines the alignment of children along the secondary axis (if the primary axis is row, then the secondary is column, and vice versa). Should children be aligned at the start, the center, the end, or stretched to fill? Available options are flex-start, center, flex-end, and stretch.

For stretch to have an effect, children must not have a fixed dimension along the secondary axis. In the following example, setting alignItems: stretch does nothing until the width: 50 is removed from the children.

import React, { Component } from 'react'; import { AppRegistry, View } from 'react-native'; class AlignItemsBasics { @@ -58,7 +58,7 @@ class AlignItemsBasics } }; -AppRegistry.registerComponent('AwesomeProject', () => AlignItemsBasics);

Going Deeper #

We've covered the basics, but there are many other styles you may need for layouts. The full list of props that control layout is documented here.

We're getting close to being able to build a real application. One thing we are still missing is a way to take user input, so let's move on to learn how to handle text input with the TextInput component.

Next →

Recently, we have been working hard to make the documentation better based on your feedback. Your responses to this yes/no style survey will help us gauge whether we moved in the right direction with the improvements. Thank you!

Take Survey

Using a ListView #

Edit on GitHub

The ListView component displays a vertically scrolling list of changing, but similarly structured, data.

ListView works well for long lists of data, where the number of items might change over time. Unlike the more generic ScrollView, the ListView only renders elements that are currently showing on the screen, not all the elements at once.

The ListView component requires two props: dataSource and renderRow. dataSource is the source of information for the list. renderRow takes one item from the source and returns a formatted component to render.

This example creates a simple ListView of hardcoded data. It first initializes the dataSource that will be used to populate the ListView. Each item in the dataSource is then rendered as a Text component. Finally it renders the ListView and all Text components.

A rowHasChanged function is required to use ListView. Here we just say a row has changed if the row we are on is not the same as the previous row.

import React, { Component } from 'react'; +Using a ListView – React Native | A framework for building native apps using React

Using a ListView #

Edit on GitHub

The ListView component displays a vertically scrolling list of changing, but similarly structured, data.

ListView works well for long lists of data, where the number of items might change over time. Unlike the more generic ScrollView, the ListView only renders elements that are currently showing on the screen, not all the elements at once.

The ListView component requires two props: dataSource and renderRow. dataSource is the source of information for the list. renderRow takes one item from the source and returns a formatted component to render.

This example creates a simple ListView of hardcoded data. It first initializes the dataSource that will be used to populate the ListView. Each item in the dataSource is then rendered as a Text component. Finally it renders the ListView and all Text components.

A rowHasChanged function is required to use ListView. Here we just say a row has changed if the row we are on is not the same as the previous row.

import React, { Component } from 'react'; import { AppRegistry, ListView, Text, View } from 'react-native'; class ListViewBasics extends Component { @@ -25,7 +25,7 @@ class ListViewBasics extends } // App registration and rendering -AppRegistry.registerComponent('AwesomeProject', () => ListViewBasics);

One of the most common uses for a ListView is displaying data that you fetch from a server. To do that, you will need to learn about networking in React Native.

Recently, we have been working hard to make the documentation better based on your feedback. Your responses to this yes/no style survey will help us gauge whether we moved in the right direction with the improvements. Thank you!

Take Survey
© 2016 Facebook Inc.

React Native Versions

React Native is following a 2-week train release. Every two weeks, a Release Candidate (rc) branch is created off of master and the previous rc branch is being officially released.

masterDocs
0.29-rcDocsRelease Notes
(current) 0.28DocsRelease Notes
0.27DocsRelease Notes
0.26DocsRelease Notes
0.25DocsRelease Notes
0.24DocsRelease Notes
0.23DocsRelease Notes
0.22DocsRelease Notes
0.21DocsRelease Notes
0.20DocsRelease Notes
0.19DocsRelease Notes
0.18DocsRelease Notes
© 2016 Facebook Inc.

React Native Versions

React Native is following a 2-week train release. Every two weeks, a Release Candidate (rc) branch is created off of master and the previous rc branch is being officially released.

masterDocs
0.30-rcDocsRelease Notes
0.29-rcDocsRelease Notes
(current) 0.28DocsRelease Notes
0.27DocsRelease Notes
0.26DocsRelease Notes
0.25DocsRelease Notes
0.24DocsRelease Notes
0.23DocsRelease Notes
0.22DocsRelease Notes
0.21DocsRelease Notes
0.20DocsRelease Notes
0.19DocsRelease Notes
0.18DocsRelease Notes
© 2016 Facebook Inc.

React Native Versions

React Native is following a 2-week train release. Every two weeks, a Release Candidate (rc) branch is created off of master and the previous rc branch is being officially released.

masterDocs
0.30-rcDocsRelease Notes
0.29-rcDocsRelease Notes
(current) 0.28DocsRelease Notes
0.27DocsRelease Notes
0.26DocsRelease Notes
0.25DocsRelease Notes
0.24DocsRelease Notes
0.23DocsRelease Notes
0.22DocsRelease Notes
0.21DocsRelease Notes
0.20DocsRelease Notes
0.19DocsRelease Notes
0.18DocsRelease Notes
© 2016 Facebook Inc.

React Native Versions

React Native is following a 2-week train release. Every two weeks, a Release Candidate (rc) branch is created off of master and the previous rc branch is being officially released.

masterDocs
0.30-rcDocsRelease Notes
0.29-rcDocsRelease Notes
(current) 0.28DocsRelease Notes
0.27DocsRelease Notes
0.26DocsRelease Notes
0.25DocsRelease Notes
0.24DocsRelease Notes
0.23DocsRelease Notes
0.22DocsRelease Notes
0.21DocsRelease Notes
0.20DocsRelease Notes
0.19DocsRelease Notes
0.18DocsRelease Notes
© 2016 Facebook Inc.
\ No newline at end of file