diff --git a/docs/activityindicatorios.html b/docs/activityindicatorios.html deleted file mode 100644 index 47a2285ef67..00000000000 --- a/docs/activityindicatorios.html +++ /dev/null @@ -1,13 +0,0 @@ -React Native | Build Native Apps Using React

ActivityIndicatorIOS

Props #

animating bool #

Whether to show the indicator (true, the default) or hide it (false).

color string #

The foreground color of the spinner (default is gray).

size enum(// default -'small', 'large') #

\ No newline at end of file diff --git a/docs/animation.html b/docs/animation.html deleted file mode 100644 index 477ef012050..00000000000 --- a/docs/animation.html +++ /dev/null @@ -1,12 +0,0 @@ -React Native | Build Native Apps Using React

Animation

@flow

Methods #

static startAnimation(node: any, duration: number, delay: number, easing: (string | EasingFunction), properties: {[key: string]: any}) #

static stopAnimation(tag: number) #

\ No newline at end of file diff --git a/docs/appregistry.html b/docs/appregistry.html deleted file mode 100644 index 2a56556c12c..00000000000 --- a/docs/appregistry.html +++ /dev/null @@ -1,18 +0,0 @@ -React Native | Build Native Apps Using React

AppRegistry

AppRegistry is the JS entry point to running all React Native apps. App -root components should register themselves with -AppRegistry.registerComponent, then the native system can load the bundle -for the app and then actually run the app when it's ready by invoking -AppRegistry.runApplication.

AppRegistry should be required early in the require sequence to make -sure the JS execution environment is setup before other modules are -required.

Methods #

static registerConfig(config) #

static registerComponent(appKey, getComponentFunc) #

static registerRunnable(appKey, func) #

static runApplication(appKey, appParameters) #

\ No newline at end of file diff --git a/docs/appstate.html b/docs/appstate.html deleted file mode 100644 index 941c6c3ab5d..00000000000 --- a/docs/appstate.html +++ /dev/null @@ -1,12 +0,0 @@ -React Native | Build Native Apps Using React

AppState

Methods #

static setApplicationIconBadgeNumber(number) #

static getApplicationIconBadgeNumber(callback) #

\ No newline at end of file diff --git a/docs/appstateios.html b/docs/appstateios.html deleted file mode 100644 index 1e5add035b0..00000000000 --- a/docs/appstateios.html +++ /dev/null @@ -1,12 +0,0 @@ -React Native | Build Native Apps Using React

AppStateIOS

Methods #

static addEventListener(type, handler) #

static removeEventListener(type, handler) #

\ No newline at end of file diff --git a/docs/asyncstorage.html b/docs/asyncstorage.html deleted file mode 100644 index d3b18acad82..00000000000 --- a/docs/asyncstorage.html +++ /dev/null @@ -1,23 +0,0 @@ -React Native | Build Native Apps Using React

AsyncStorage

AsyncStorage is a simple, asynchronous, persistent, global, key-value storage -system. It should be used instead of LocalStorage.

It is recommended that you use an abstraction on top of AsyncStorage instead -of AsyncStorage directly for anything more than light usage since it -operates globally.

This JS code is a simple facad over the native iOS implementation to provide -a clear JS API, real Error objects, and simple non-multi functions.

Methods #

static getItem(key: string, callback: (error: ?Error, result: ?string) => void) #

Fetches key and passes the result to callback, along with an Error if -there is any.

static setItem(key: string, value: string, callback: ?(error: ?Error) => void) #

Sets value for key and calls callback on completion, along with an -Error if there is any.

static removeItem(key: string, callback: ?(error: ?Error) => void) #

static mergeItem(key: string, value: string, callback: ?(error: ?Error) => void) #

Merges existing value with input value, assuming they are stringified json.

Not supported by all native implementations.

static clear(callback: ?(error: ?Error) => void) #

Erases all AsyncStorage for all clients, libraries, etc. You probably -don't want to call this - use removeItem or multiRemove to clear only your -own keys instead.

static getAllKeys(callback: (error: ?Error) => void) #

Gets all keys known to the system, for all callers, libraries, etc.

static multiGet(keys: Array<string>, callback: (errors: ?Array<Error>, result: ?Array<Array<string>>) => void) #

multiGet invokes callback with an array of key-value pair arrays that -matches the input format of multiSet.

multiGet(['k1', 'k2'], cb) -> cb([['k1', 'val1'], ['k2', 'val2']])

static multiSet(keyValuePairs: Array<Array<string>>, callback: ?(errors: ?Array<Error>) => void) #

multiSet and multiMerge take arrays of key-value array pairs that match -the output of multiGet, e.g.

multiSet([['k1', 'val1'], ['k2', 'val2']], cb);

static multiRemove(keys: Array<string>, callback: ?(errors: ?Array<Error>) => void) #

Delete all the keys in the keys array.

static multiMerge(keyValuePairs: Array<Array<string>>, callback: ?(errors: ?Array<Error>) => void) #

Merges existing values with input values, assuming they are stringified -json.

Not supported by all native implementations.

\ No newline at end of file diff --git a/docs/cameraroll.html b/docs/cameraroll.html deleted file mode 100644 index 9b9dacb01d8..00000000000 --- a/docs/cameraroll.html +++ /dev/null @@ -1,19 +0,0 @@ -React Native | Build Native Apps Using React

CameraRoll

Methods #

static saveImageWithTag(tag: string, successCallback, errorCallback) #

Saves the image with tag tag to the camera roll.

@param {string} tag - Can be any of the three kinds of tags we accept: -1. URL -2. assets-library tag -3. tag returned from storing an image in memory

static getPhotos(params: object, callback: function, errorCallback: function) #

Invokes callback with photo identifier objects from the local camera -roll of the device matching shape defined by getPhotosReturnChecker.

@param {object} params - See getPhotosParamChecker. -@param {function} callback - Invoked with arg of shape defined by -getPhotosReturnChecker on success. -@param {function} errorCallback - Invoked with error message on error.

\ No newline at end of file diff --git a/docs/datepickerios.html b/docs/datepickerios.html deleted file mode 100644 index 45d8c073b0b..00000000000 --- a/docs/datepickerios.html +++ /dev/null @@ -1,20 +0,0 @@ -React Native | Build Native Apps Using React

DatePickerIOS

Use DatePickerIOS to render a date/time picker (selector) on iOS. This is -a controlled component, so you must hook in to the onDateChange callback -and update the date prop in order for the component to update, otherwise -the user's change will be reverted immediately to reflect props.date as the -source of truth.

Props #

date Date #

The currently selected date.

maximumDate Date #

Maximum date.

Restricts the range of possible date/time values.

minimumDate Date #

Minimum date.

Restricts the range of possible date/time values.

minuteInterval enum(1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30) #

The interval at which minutes can be selected.

mode Object.keys(RKDatePickerIOSConsts.DatePickerModes) #

The date picker mode.

Valid modes on iOS are: 'date', 'time', 'datetime'.

onDateChange func #

Date change handler.

This is called when the user changes the date or time in the UI. -The first and only argument is a Date object representing the new -date and time.

timeZoneOffsetInMinutes number #

Timezone offset in seconds.

By default, the date picker will use the device's timezone. With this -parameter, it is possible to force a certain timezone offset. For -instance, to show times in Pacific Standard Time, pass -7 * 60.

\ No newline at end of file diff --git a/docs/expandingtext.html b/docs/expandingtext.html deleted file mode 100644 index 7d1b030f327..00000000000 --- a/docs/expandingtext.html +++ /dev/null @@ -1,25 +0,0 @@ -React Native | Build Native Apps Using React

ExpandingText

A react component for displaying text which supports truncating -based on a set truncLength.

In the following example, the text will truncate -to show only the first 17 characters plus '...' with a See More button to -expand the text to its full length.

render: function() { - return <ExpandingText truncLength={20} text={EXAMPLE_TEXT} />; -},

Props #

seeMoreStyle Text.propTypes.style #

The styles that will be applied to the See More button. Default -is bold.

seeMoreText string #

The caption that will be appended at the end, by default it is -'See More'.

text string #

Text to be displayed. It will be truncated if the character length -is greater than the truncLength property.

textStyle Text.propTypes.style #

The styles that will be applied to the text (both truncated and -expanded).

truncLength number #

The maximum character length for the text that will -be displayed by default. Note that ... will be -appended to the truncated text which is counted towards -the total truncLength of the default displayed string. -The default is 130.

\ No newline at end of file diff --git a/docs/getting-started.html b/docs/getting-started.html deleted file mode 100644 index d9c23752ad2..00000000000 --- a/docs/getting-started.html +++ /dev/null @@ -1,33 +0,0 @@ -React Native | Build Native Apps Using React

Getting Started

Our first React Native implementation is ReactKit, targeting iOS. We are also -working on an Android implementation which we will release later. ReactKit -apps are built using the React JS framework, and render directly to -native UIKit elements using a fully asynchronous architecture. There is no -browser and no HTML. We have picked what we think is the best set of features -from these and other technologies to build what we hope to become the best -product development framework available, with an emphasis on iteration speed, -developer delight, continuity of technology, and absolutely beautiful and fast -products with no compromises in quality or capability.

Requirements #

  1. OS X - This repo only contains the iOS implementation right now, and Xcode only runs on Mac.
  2. New to Xcode? Download it from the Mac App Store.
  3. Homebrew is the recommended way to install node, watchman, and flow.
  4. New to node or npm? brew install node
  5. We recommend installing watchman, otherwise you might hit a node file watching bug. brew install watchman
  6. If you want to use flow, brew install flow

Quick start #

Get up and running with our Movies sample app:

  1. Once you have the repo cloned and met all the requirements above, start the -packager that will transform your JS code on-the-fly:

    npm install -npm start
  2. Open the Examples/Movies/Movies.xcodeproj project in Xcode.
  3. Make sure the target is set to Movies and that you have an iOS simulator -selected to run the app.
  4. Build and run the project with the Xcode run button.

You should now see the Movies app running on your iOS simulator. -Congratulations! You've just successfully run your first React Native app.

Now try editing a JavaScript file and viewing your changes. Let's change the -movie search placeholder text:

  1. Open the Examples/Movies/SearchScreen.js file in your favorite JavaScript -editor.
  2. Look for the current search placeholder text and change it to "Search for an -awesome movie...".
  3. Hit cmd+R (twice) in your iOS simulator to reload the app and see your change. -If you don't immediately see your changes, try restarting your app within Xcode.

Feel free to browse the Movies sample files and customize various properties to -get familiar with the codebase and React Native.

Also check out the UI Component Explorer for more sample code: -Examples/UIExplorer/UIExplorer.xcodeproj. Make sure to close the Movies -project first - Xcode will break if you have two projects open that reference -the same library.

Troubleshooting #

  • Xcode will break if you have two examples open at the same time.
  • If npm start fails with log spew like:
    2015-02-02 10:56 node[24294] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-21)
    then you've hit the node file watching bug - brew install watchman should fix the issue.
  • Jest testing does not yet work on node versions after 0.10.x.
  • You can verify the packager is working by loading the bundle in your browser and -inspecting the contents.

Please report any other issues you encounter so we can fix them ASAP.

\ No newline at end of file diff --git a/docs/image.html b/docs/image.html deleted file mode 100644 index 2ade56e1395..00000000000 --- a/docs/image.html +++ /dev/null @@ -1,47 +0,0 @@ -React Native | Build Native Apps Using React

Image

A react component for displaying different types of images, -including network images, static resources, temporary local images, and -images from local disk, such as the camera roll.

Example usage:

renderImages: function() { - return ( - <View> - <Image - style={styles.icon} - source={ix('myIcon')} - /> - <Image - style={styles.logo} - source={{uri: 'http://facebook.github.io/react/img/logo_og.png'}} - /> - </View> - ); -},

Props #

accessibilityLabel string #

accessibilityLabel - Custom string to display for accessibility.

accessible bool #

accessible - Whether this element should be revealed as an accessible -element.

capInsets EdgeInsetsPropType #

capInsets - When the image is resized, the corners of the size specified -by capInsets will stay a fixed size, but the center content and borders -of the image will be stretched. This is useful for creating resizable -rounded buttons, shadows, and other resizable assets. More info:

https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIImage_Class/index.html#//apple_ref/occ/instm/UIImage/resizableImageWithCapInsets:

source {uri: string} #

style StyleSheetPropType(ImageStylePropTypes) #

testID string #

testID - A unique identifier for this element to be used in UI Automation -testing scripts.

Displaying images is a fascinating subject, React Native uses some cool tricks to make it a better experience.

No Automatic Sizing #

If you don't give a size to an image, the browser is going to render a 0x0 element, download the image, and then render the image based with the correct size. The big issue with this behavior is that your UI is going to jump all around as images load, this makes for a very bad user experience.

In React Native, this behavior is intentionally not implemented. It is more work for the developer to know the dimensions (or just aspect ratio) of the image in advance, but we believe that it leads to a better user experience.

Background Image via Nesting #

A common feature request from developers familiar with the web is background-image. It turns out that iOS has a very elegant solution to this: you can add elements as a children to an <Image> component. This simplifies the API and solves the use case.

return ( - <Image source={...}> - <Text>Inside</Text> - </Image> -);

Off-thread Decoding #

Image decoding can take more than a frame-worth of time. This is one of the major source of frame drops on the web because decoding is done in the main thread. In React Native, image decoding is done in a different thread. In practice, you already need to handle the case when the image is not downloaded yet, so displaying the placeholder for a few more frames while it is decoding does not require any code change.

Static Assets #

In the course of a project you add and remove images and in many instances, you end up shipping images you are not using anymore in the app. In order to fight this, we need to find a way to know statically which images are being used in the app. To do that, we introduced a marker called ix. The only allowed way to refer to an image in the bundle is to literally write ix('name-of-the-asset') in the source.

var { ix } = React; - -// GOOD -<Image source={ix('my-icon')} /> - -// BAD -var icon = this.props.active ? 'my-icon-active' : 'my-icon-inactive'; -<Image source={ix(icon)} /> - -// GOOD -var icon = this.props.active ? ix('my-icon-active') : ix('my-icon-inactive'); -<Image source={icon} />

When your entire codebase respects this convention, you're able to do interesting things like automatically packaging the assets that are being used in your app. Note that in the current form, nothing is enforced, but it will be in the future.

Best Camera Roll Image #

iOS saves multiple sizes for the same image in your Camera Roll, it is very important to pick the one that's as close as possible for performance reasons. You wouldn't want to use the full quality 3264x2448 image as source when displaying a 200x200 thumbnail. If there's an exact match, React Native will pick it, otherwise it's going to use the first one that's at least 50% bigger in order to avoid blur when resizing from a close size. All of this is done by default so you don't have to worry about writing the tedious (and error prone) code to do it yourself.

Source being an object #

In React Native, one interesting decision is that the src attribute is named source and doesn't take a string but an object with an uri attribute.

<Image source={{uri: 'something.jpg'}} />

On the infrastructure side, the reason is that it allows to attach metadata to this object. For example if you are using ix, then we add a isStored attribute to flag it as a local file (don't rely on this fact, it's likely to change in the future!). This is also future proofing, for example we may want to support sprites at some point, instead of outputting {uri: ...}, we can output {uri: ..., crop: {left: 10, top: 50, width: 20, height: 40}} and transparently support spriting on all the existing call sites.

On the user side, this lets you annotate the object with useful attributes such as the dimension of the image in order to compute the size it's going to be displayed in. Feel free to use it as your data structure to store more information about your image.

\ No newline at end of file diff --git a/docs/layoutanimation.html b/docs/layoutanimation.html deleted file mode 100644 index 1046388a6e9..00000000000 --- a/docs/layoutanimation.html +++ /dev/null @@ -1,12 +0,0 @@ -React Native | Build Native Apps Using React

LayoutAnimation

Methods #

static configureNext(config, onAnimationDidEnd, onError) #

static create(duration, type, creationProp) #

\ No newline at end of file diff --git a/docs/listview.html b/docs/listview.html deleted file mode 100644 index bde0f443e8d..00000000000 --- a/docs/listview.html +++ /dev/null @@ -1,64 +0,0 @@ -React Native | Build Native Apps Using React

ListView

ListView - A core component designed for efficient display of vertically -scrolling lists of changing data. The minimal API is to create a -ListView.DataSource, populate it with a simple array of data blobs, and -instantiate a ListView component with that data source and a renderRow -callback which takes a blob from the data array and returns a renderable -component.

Minimal example:

getInitialState: function() { - var ds = new ListViewDataSource({rowHasChanged: (r1, r2) => r1 !== r2}); - return { - dataSource: ds.cloneWithRows(['row 1', 'row 2']), - }; -}, - -render: function() { - return ( - <ListView - dataSource={this.state.dataSource} - renderRow={(rowData) => <Text>{rowData}</Text>} - /> - ); -},

ListView also supports more advanced features, including sections with sticky -section headers, header and footer support, callbacks on reaching the end of -the available data (onEndReached) and on the set of rows that are visible -in the device viewport change (onChangeVisibleRows), and several -performance optimizations.

There are a few performance operations designed to make ListView scroll -smoothly while dynamically loading potentially very large (or conceptually -infinite) data sets:

  • Only re-render changed rows - the hasRowChanged function provided to the -data source tells the ListView if it needs to re-render a row because the -source data has changed - see ListViewDataSource for more details.

  • Rate-limited row rendering - By default, only one row is rendered per -event-loop (customizable with the pageSize prop). This breaks up the -work into smaller chunks to reduce the chance of dropping frames while -rendering rows.

Props #

dataSource ListViewDataSource #

initialListSize number #

How many rows to render on initial component mount. Use this to make -it so that the first screen worth of data apears at one time instead of -over the course of multiple frames.

onChangeVisibleRows func #

(visibleRows, changedRows) => void

Called when the set of visible rows changes. visibleRows maps -{ sectionID: { rowID: true }} for all the visible rows, and -changedRows maps { sectionID: { rowID: true | false }} for the rows -that have changed their visibility, with true indicating visible, and -false indicating the view has moved out of view.

onEndReached func #

Called when all rows have been rendered and the list has been scrolled -to within onEndReachedThreshold of the bottom. The native scroll -event is provided.

onEndReachedThreshold number #

Threshold in pixels for onEndReached.

pageSize number #

Number of rows to render per event loop.

removeClippedSubviews bool #

An experimental performance optimization for improving scroll perf of -large lists, used in conjunction with overflow: 'hidden' on the row -containers. Use at your own risk.

renderFooter func #

() => renderable

The header and footer are always rendered (if these props are provided) -on every render pass. If they are expensive to re-render, wrap them -in StaticContainer or other mechanism as appropriate. Footer is always -at the bottom of the list, and header at the top, on every render pass.

renderHeader func #

renderRow func #

(rowData, sectionID, rowID) => renderable -Takes a data entry from the data source and its ids and should return -a renderable component to be rendered as the row. By default the data -is exactly what was put into the data source, but it's also possible to -provide custom extractors.

renderSectionHeader func #

(sectionData, sectionID) => renderable

If provided, a sticky header is rendered for this section. The sticky -behavior means that it will scroll with the content at the top of the -section until it reaches the top of the screen, at which point it will -stick to the top until it is pushed off the screen by the next section -header.

scrollRenderAheadDistance number #

How early to start rendering rows before they come on screen, in -pixels.

\ No newline at end of file diff --git a/docs/mapview.html b/docs/mapview.html deleted file mode 100644 index f19a248b580..00000000000 --- a/docs/mapview.html +++ /dev/null @@ -1,28 +0,0 @@ -React Native | Build Native Apps Using React

MapView

Props #

legalLabelInsets EdgeInsetsPropType #

Insets for the map's legal label, originally at bottom left of the map. -See EdgeInsetsPropType.js for more information.

maxDelta number #

Maximum size of area that can be displayed.

minDelta number #

Minimum size of area that can be displayed.

onRegionChange func #

Callback that is called continuously when the user is dragging the map.

onRegionChangeComplete func #

Callback that is called once, when the user is done moving the map.

pitchEnabled bool #

When this property is set to true and a valid camera is associated -with the map, the camera’s pitch angle is used to tilt the plane -of the map. When this property is set to false, the camera’s pitch -angle is ignored and the map is always displayed as if the user -is looking straight down onto it.

region {latitude: number, longitude: number, latitudeDelta: number, longitudeDelta: number} #

The region to be displayed by the map.

The region is defined by the center coordinates and the span of -coordinates to display.

rotateEnabled bool #

When this property is set to true and a valid camera is associated with -the map, the camera’s heading angle is used to rotate the plane of the -map around its center point. When this property is set to false, the -camera’s heading angle is ignored and the map is always oriented so -that true north is situated at the top of the map view

scrollEnabled bool #

If false the user won't be able to change the map region being displayed. -Default value is true.

showsUserLocation bool #

If true the app will ask for the user's location and focus on it. -Default value is false.

NOTE: You need to add NSLocationWhenInUseUsageDescription key in -Info.plist to enable geolocation, otherwise it is going -to fail silently!

style View.propTypes.style #

Used to style and layout the MapView. See StyleSheet.js and -ViewStylePropTypes.js for more info.

zoomEnabled bool #

If false the user won't be able to pinch/zoom the map. -Default value is true.

\ No newline at end of file diff --git a/docs/navigatorios.html b/docs/navigatorios.html deleted file mode 100644 index dd8f649412a..00000000000 --- a/docs/navigatorios.html +++ /dev/null @@ -1,50 +0,0 @@ -React Native | Build Native Apps Using React

NavigatorIOS

NavigatorIOS wraps UIKit navigation and allows you to add back-swipe -functionality across your app.

Routes #

A route is an object used to describe each page in the navigator. The first -route is provided to NavigatorIOS as initialRoute:

render: function() { - return ( - <NavigatorIOS - initialRoute={{ - component: MyView, - title: 'My View Title', - passProps: { myProp: 'foo' }, - }} - /> - ); -},

Now MyView will be rendered by the navigator. It will recieve the route -object in the route prop, a navigator, and all of the props specified in -passProps.

See the initialRoute propType for a complete definition of a route.

Navigator #

A navigator is an object of navigation functions that a view can call. It -is passed as a prop to any component rendered by NavigatorIOS.

var MyView = React.createClass({ - _handleBackButtonPress: function() { - this.props.navigator.pop(); - }, - _handleNextButtonPress: function() { - this.props.navigator.push(nextRoute); - }, - ... -});

A navigation object contains the following functions:

  • push(route) - Navigate forward to a new route
  • pop() - Go back one page
  • popN(n) - Go back N pages at once. When N=1, behavior matches pop()
  • replace(route) - Replace the route for the current page and immediately -load the view for the new route
  • replacePrevious(route) - Replace the route/view for the previous page
  • replacePreviousAndPop(route) - Replaces the previous route/view and -transitions back to it
  • resetTo(route) - Replaces the top item and popToTop
  • popToRoute(route) - Go back to the item for a particular route object
  • popToTop() - Go back to the top item

Navigator functions are also available on the NavigatorIOS component:

var MyView = React.createClass({ - _handleNavigationRequest: function() { - this.refs.nav.push(otherRoute); - }, - render: () => ( - <NavigatorIOS - ref="nav" - initialRoute={...} - /> - ), -});

Props #

initialRoute {component: func, title: string, passProps: object, backButtonTitle: string, rightButtonTitle: string, onRightButtonPress: func, wrapperStyle: View.propTypes.style} #

NavigatorIOS uses "route" objects to identify child views, their props, -and navigation bar configuration. "push" and all the other navigation -operations expect routes to be like this:

itemWrapperStyle View.propTypes.style #

The default wrapper style for components in the navigator. -A common use case is to set the backgroundColor for every page

tintColor string #

The color used for buttons in the navigation bar

\ No newline at end of file diff --git a/docs/network.html b/docs/network.html deleted file mode 100644 index 0759717e11e..00000000000 --- a/docs/network.html +++ /dev/null @@ -1,33 +0,0 @@ -React Native | Build Native Apps Using React

Network

One of React Native goal is to be a playground where we can experiment with different architectures and crazy ideas. Since browsers are not flexible enough, we had no choice but to reimplement the entire stack. In the places that we did not intend to change, we tried to be as faithful as possible to the browser APIs, the networking stack is a great example.

XMLHttpRequest #

XMLHttpRequest API is implemented on-top of iOS networking apis. The notable difference from web is the security model: you can read from arbitrary websites on the internet, there isn't no concept of CORS.

var request = new XMLHttpRequest(); -request.onreadystatechange = (e) => { - if (request.readyState !== 4) { - return; - } - - if (request.status === 200) { - console.log('success', request.responseText); - } else { - console.warn('error'); - } -}; - -request.open('GET', 'https://mywebsite.com/endpoint.php'); -request.send();

Please follow the MDN Documentation for a description of the API.

As a developer, you're probably not going to use XMLHttpRequest directly as its API is very tedious to work with. But the fact that it is implemented and compatible with the browser one gives you the ability to use third-party libraries such as Parse JS SDK or super-agent directly from npm.

Fetch #

fetch is a better API being worked on by the standard committee and already available in Chrome. It is available in React Native by default.

fetch('https://mywebsite.com/endpoint.php') - .then((response) => response.text()) - .then((responseText) => { - console.log(responseText); - }) - .catch((error) => { - console.warn(error); - });
\ No newline at end of file diff --git a/docs/pickerios.html b/docs/pickerios.html deleted file mode 100644 index 675d451b868..00000000000 --- a/docs/pickerios.html +++ /dev/null @@ -1,12 +0,0 @@ -React Native | Build Native Apps Using React

PickerIOS

Props #

onValueChange func #

selectedValue any #

\ No newline at end of file diff --git a/docs/pixelratio.html b/docs/pixelratio.html deleted file mode 100644 index 50c0ac229d6..00000000000 --- a/docs/pixelratio.html +++ /dev/null @@ -1,24 +0,0 @@ -React Native | Build Native Apps Using React

PixelRatio

PixelRatio class gives access to the device pixel density.

Some examples: -- PixelRatio.get() === 2 -- iPhone 4, 4S -- iPhone 5, 5c, 5s -- iPhone 6

  • PixelRatio.get() === 3
  • iPhone 6 plus

There are a few use cases for using PixelRatio:

== Displaying a line that's as thin as the device permits

A width of 1 is actually pretty thick on an iPhone 4+, we can do one that's -thinner using a width of 1 / PixelRatio.get(). It's a technique that works -on all the devices independent of their pixel density.

style={{ borderWidth: 1 / PixelRatio.get() }}

== Fetching a correctly sized image

You should get a higher resolution image if you are on a high pixel density -device. A good rule of thumb is to multiply the size of the image you display -by the pixel ratio.

var image = getImage({ -width: 200 PixelRatio.get(), -height: 100 PixelRatio.get() -});

<Image source={image} style={{width: 200, height: 100}} /> -

Methods #

static get() #

static startDetecting() #

\ No newline at end of file diff --git a/docs/pixels.html b/docs/pixels.html deleted file mode 100644 index 2460f6c0b4d..00000000000 --- a/docs/pixels.html +++ /dev/null @@ -1,16 +0,0 @@ -React Native | Build Native Apps Using React

Physical vs Logical Pixels

Pixel Grid Snapping #

In iOS, you can specify positions and dimensions for elements with arbitrary precision, for example 29.674825. But, ultimately the physical display only have a fixed number of pixels, for example 640×960 for iphone 4 or 750×1334 for iphone 6. iOS tries to be as faithful as possible to the user value by spreading one original pixel into multiple ones to be trick the eye. The downside of this technique is that it makes the resulting element look blurry.

In practice, we found out that developers do not want this feature and they have to work around it by doing manual rounding in order to avoid having blurry elements. In React Native, we are rounding all the pixels automatically.

We have to be careful when to do this rounding. You never want to work with rounded and unrounded values at the same time as you're going to accumulate rounding errors. Having even one rounding error is deadly because a one pixel border may vanish or be twice as big.

In React Native, everything in JS and within the layout engine work with arbitrary precision numbers. It's only when we set the position and dimensions of the native element on the main thread that we round. Also, rounding is done relative to the root rather than the parent, again to avoid accumulating rounding errors.

Displaying a line that's as thin as the device permits #

A width of 1 is actually 2 physical pixels thick on an iPhone 4 and ~3 physical pixels thick on an iphone 6+. If you want to display a line that's as thin as possible, you can use a width of 1 / PixelRatio.get(). It's a technique that works on all the devices independent of their pixel density.

style={{ borderWidth: 1 / PixelRatio.get() }}

Fetching a correctly sized image #

You should get a higher resolution image if you are on a high pixel density device. A good rule of thumb is to multiply the size of the image you display by the pixel ratio.

var image = getImage({ - width: 200 * PixelRatio.get(), - height: 100 * PixelRatio.get(), -}); -<Image source={image} style={{width: 200, height: 100}} />
\ No newline at end of file diff --git a/docs/scrollview.html b/docs/scrollview.html deleted file mode 100644 index 4f3601af698..00000000000 --- a/docs/scrollview.html +++ /dev/null @@ -1,54 +0,0 @@ -React Native | Build Native Apps Using React

ScrollView

Component that wraps platform ScrollView while providing -integration with touch locking "responder" system.

Doesn't yet support other contained responders from blocking this scroll -view from becoming the responder.

Props #

alwaysBounceHorizontal bool #

When true, the scroll view bounces horizontally when it reaches the end -even if the content is smaller than the scroll view itself. The default -value is true when horizontal={true} and false otherwise.

alwaysBounceVertical bool #

When true, the scroll view bounces vertically when it reaches the end -even if the content is smaller than the scroll view itself. The default -value is false when horizontal={true} and true otherwise.

automaticallyAdjustContentInsets bool #

centerContent bool #

When true, the scroll view automatically centers the content when the -content is smaller than the scroll view bounds; when the content is -larger than the scroll view, this property has no effect. The default -value is false.

contentContainerStyle StyleSheetPropType(ViewStylePropTypes) #

These styles will be applied to the scroll view content container which -wraps all of the child views. Example:

return ( - <ScrollView contentContainerStyle={styles.contentContainer}> - </ScrollView> - ); - ... - var styles = StyleSheet.create({ - contentContainer: { - paddingVertical: 20 - } - });

contentInset EdgeInsetsPropType #

contentOffset PointPropType #

decelerationRate number #

A floating-point number that determines how quickly the scroll view -decelerates after the user lifts their finger. Reasonable choices include - - Normal: 0.998 (the default) - - Fast: 0.9

horizontal bool #

When true, the scroll view's children are arranged horizontally in a row -instead of vertically in a column. The default value is false.

keyboardDismissMode enum(// default -'none', 'interactive', 'onDrag') #

Determines whether the keyboard gets dismissed in response to a drag. - - 'none' (the default), drags do not dismiss the keyboard. - - 'onDrag', the keyboard is dismissed when a drag begins. - - 'interactive', the keyboard is dismissed interactively with the drag - and moves in synchrony with the touch; dragging upwards cancels the - dismissal.

keyboardShouldPersistTaps bool #

When false, tapping outside of the focused text input when the keyboard -is up dismisses the keyboard. When true, the scroll view will not catch -taps, and the keyboard will not dismiss automatically. The default value -is false.

maximumZoomScale number #

The maximum allowed zoom scale. The default value is 1.0.

minimumZoomScale number #

The minimum allowed zoom scale. The default value is 1.0.

onScroll func #

onScrollAnimationEnd func #

pagingEnabled bool #

When true, the scroll view stops on multiples of the scroll view's size -when scrolling. This can be used for horizontal pagination. The default -value is false.

removeClippedSubviews bool #

Experimental: When true, offscreen child views (whose overflow value is -hidden) are removed from their native backing superview when offscreen. -This canimprove scrolling performance on long lists. The default value is -false.

scrollEnabled bool #

scrollIndicatorInsets EdgeInsetsPropType #

scrollsToTop bool #

When true, the scroll view scrolls to top when the status bar is tapped. -The default value is true.

showsHorizontalScrollIndicator bool #

showsVerticalScrollIndicator bool #

stickyHeaderIndices [number] #

An array of child indices determining which children get docked to the -top of the screen when scrolling. For example, passing -stickyHeaderIndices={[0]} will cause the first child to be fixed to the -top of the scroll view. This property is not supported in conjunction -with horizontal={true}.

style StyleSheetPropType(ViewStylePropTypes) #

throttleScrollCallbackMS number #

zoomScale number #

The current scale of the scroll view content. The default value is 1.0.

\ No newline at end of file diff --git a/docs/slider.html b/docs/slider.html deleted file mode 100644 index c2c31b5e990..00000000000 --- a/docs/slider.html +++ /dev/null @@ -1,16 +0,0 @@ -React Native | Build Native Apps Using React

Slider

Props #

onSlidingComplete func #

Callback called when the user finishes changing the value (e.g. when -the slider is released).

onValueChange func #

Callback continuously called while the user is dragging the slider.

style View.propTypes.style #

Used to style and layout the Slider. See StyleSheet.js and -ViewStylePropTypes.js for more info.

value number #

Initial value of the slider. The value should be between 0 and 1. -Default value is 0.

This is not a controlled component, e.g. if you don't update -the value, the component won't be reseted to it's inital value.

\ No newline at end of file diff --git a/docs/statusbarios.html b/docs/statusbarios.html deleted file mode 100644 index 2b890dc7626..00000000000 --- a/docs/statusbarios.html +++ /dev/null @@ -1,12 +0,0 @@ -React Native | Build Native Apps Using React

StatusBarIOS

@flow

Methods #

static setStyle(style: number, animated: boolean) #

static setHidden(hidden: boolean, animation: number) #

\ No newline at end of file diff --git a/docs/style.html b/docs/style.html deleted file mode 100644 index 81e39f68824..00000000000 --- a/docs/style.html +++ /dev/null @@ -1,47 +0,0 @@ -React Native | Build Native Apps Using React

Style

Declaring Styles #

The way to declare styles in React Native is the following:

var styles = StyleSheet.create({ - base: { - width: 38, - height: 38, - }, - background: { - backgroundColor: '#222222', - }, - active: { - borderWidth: 2, - borderColor: '#00ff00', - }, -});

StyleSheet.create construct is optional but provides some key advantages. It ensures that the values are immutable and opaque by transforming them into plain numbers that reference an internal table. By putting it at the end of the file, you also ensure that they are only created once for the application and not on every render.

Using Styles #

All the core components accept a style attribute

<Text style={styles.base} /> -<View style={styles.background} />

and also accepts an array of styles

<View style={[style.base, style.background]} />

The behavior is the same as Object.assign: in case of conflicting values, the one from the right-most element will have precedence and falsy values like false, undefined and null will be ignored. A common pattern is to conditionally add a style based on some condition.

<View style={[style.base, this.state.active && style.active]} />

Finally, if you really have to, you can also create style objects in render, but they are highly discouraged. Put them last in the array definition.

<View - style={[style.base, { - width: this.state.width, - height: this.state.width * this.state.aspectRatio - }]} -/>

Pass Styles Around #

In order to let a call site customize the style of your component children, you can pass styles around. Use View.stylePropType and Text.stylePropType in order to make sure only styles are being passed.

var List = React.createClass({ - propTypes: { - style: View.stylePropType, - elementStyle: View.stylePropType, - }, - render: function() { - return ( - <View style={this.props.style}> - {elements.map((element) => - <View style={[styles.element, this.props.elementStyle]} /> - )} - </View> - ); - } -}); - -// ... in another file ... -<List style={styles.list} elementStyle={styles.listElement} />
\ No newline at end of file diff --git a/docs/stylesheet.html b/docs/stylesheet.html deleted file mode 100644 index d0d6a2706a0..00000000000 --- a/docs/stylesheet.html +++ /dev/null @@ -1,37 +0,0 @@ -React Native | Build Native Apps Using React

StyleSheet

A StyleSheet is an abstraction similar to CSS StyleSheets

Create a new StyleSheet:

var styles = StyleSheet.create({ -container: { -borderRadius: 4, -borderWidth: 0.5, -borderColor: '#d6d7da', -}, -title: { -fontSize: 19, -fontWeight: 'bold', -}, -activeTitle: { -color: 'red', -}, -})

Use a StyleSheet:

<View style={styles.container}> -<Text style={[styles.title, this.props.isActive && styles.activeTitle]} /> -</View> - -

Code quality: -- By moving styles away from the render function, you're making the code -code easier to understand. -- Naming the styles is a good way to add meaning to the low level components -in the render function.

Performance: -- Making a stylesheet from a style object makes it possible to refer to it -by ID instead of creating a new style object every time. -- It also allows to send the style only once through the bridge. All -subsequent uses are going to refer an id (not implemented yet).

Methods #

static create(obj) #

static validateStyleProp(prop, style, caller) #

static validateStyle(name, styles) #

static addValidStylePropTypes(stylePropTypes) #

\ No newline at end of file diff --git a/docs/switchios.html b/docs/switchios.html deleted file mode 100644 index 40f2819ef9d..00000000000 --- a/docs/switchios.html +++ /dev/null @@ -1,18 +0,0 @@ -React Native | Build Native Apps Using React

SwitchIOS

Use SwitchIOS to render a boolean input on iOS. This is -a controlled component, so you must hook in to the onValueChange callback -and update the value prop in order for the component to update, otherwise -the user's change will be reverted immediately to reflect props.value as the -source of truth.

Props #

disabled bool #

If true the user won't be able to toggle the switch. -Default value is false.

onTintColor string #

Background color when the switch is turned on.

onValueChange func #

Callback that is called when the user toggles the switch.

thumbTintColor string #

Background color for the switch round button.

tintColor string #

Background color when the switch is turned off.

value bool #

The value of the switch, if true the switch will be turned on. -Default value is false.

\ No newline at end of file diff --git a/docs/tabbarios.html b/docs/tabbarios.html deleted file mode 100644 index 7f494d0a989..00000000000 --- a/docs/tabbarios.html +++ /dev/null @@ -1,12 +0,0 @@ -React Native | Build Native Apps Using React

TabBarIOS

Props #

\ No newline at end of file diff --git a/docs/text.html b/docs/text.html deleted file mode 100644 index 2dce8788678..00000000000 --- a/docs/text.html +++ /dev/null @@ -1,88 +0,0 @@ -React Native | Build Native Apps Using React

Text

A react component for displaying text which supports nesting, -styling, and touch handling. In the following example, the nested title and -body text will inherit the fontFamily from styles.baseText, but the title -provides its own additional styles. The title and body will stack on top of -each other on account of the literal newlines:

renderText: function() { - return ( - <Text style={styles.baseText}> - <Text style={styles.titleText} onPress={this.onPressTitle}> - {this.state.titleText + '\n\n'} - </Text> - <Text numberOfLines={5}> - {this.state.bodyText} - </Text> - </Text> - ); -}, -... -var styles = StyleSheet.create({ - baseText: { - fontFamily: 'Cochin', - }, - titleText: { - fontSize: 20, - fontWeight: 'bold', - }, -};

Props #

numberOfLines number #

Used to truncate the text with an elipsis after computing the text -layout, including line wrapping, such that the total number of lines does -not exceed this number.

onPress func #

This function is called on press. Text intrinsically supports press -handling with a default highlight state (which can be disabled with -suppressHighlighting).

style stylePropType #

suppressHighlighting bool #

When true, no visual change is made when text is pressed down. By -default, a gray oval highlights the text on press down.

testID string #

Used to locate this view in end-to-end tests.

Nested Text #

In iOS, the way to display formatted text is by using NSAttributedString: you give the text that you want to display and annotate ranges with some specific formatting. In practice, this is very tedious. For React Native, we decided to use web paradigm for this where you can nest text to achieve the same effect.

<Text style={{fontWeight: 'bold'}}> - I am bold - <Text style={{color: 'red'}}> - and red - </Text> -</Text>

Behind the scenes, this is going to be converted to a flat NSAttributedString that contains the following information

"I am bold and red" -0-9: bold -9-17: bold, red

Containers #

The <Text> element is special relative to layout, everything inside is no longer using the flexbox layout but using text layout. This means that elements inside of a <Text> are no longer rectangles but wrap when they see the end of the line.

<Text> - <Text>First part and </Text> - <Text>second part</Text> -</Text> -// Text container: all the text flows as if it was one -// |First part | -// |and second | -// |part | - -<View> - <Text>First part and </Text> - <Text>second part</Text> -</View> -// View container: each text is its own block -// |First part | -// |and | -// |second part|

Limited Style Inheritance #

On the web, the usual way to set a font family and size for the entire document is to write

/* CSS, *not* React Native */ -html { - font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; - font-size: 11px; - color: #141823; -}

When the browser is trying to render a text node, it's going to go all the way up to the root element of the tree and find an element with a font-size attribute. An unexpected property with this system is that any node can have font-size attribute, including a <div>. The reason why it was designed this way is that it is convenient, even though not really semantically correct.

In React Native, we are more strict about it. The first place where it'll show up is that you have to wrap all the text nodes inside of a <Text> component. It is not allowed to have a text node directly under a <View>.

// BAD: will fatal, can't have a text node as child of a <View> -<View> - Some text -</View> - -// GOOD -<View> - <Text> - Some text - </Text> -</View>

You also lose the ability to setup a default font for an entire subtree. The recommended way to use consistent fonts and sizes across your application is to create a component MyAppText that's going to set them and use this component all across your app. You can also make other components such as MyAppHeaderText for other kind of texts.

<View> - <MyAppText>Text styled with the default font for the entire application</MyAppText> - <MyAppHeaderText>Text styled as a header</MyAppHeaderText> -</View>

React Native still has the concept of style inheritance, but limited to text subtrees. In this case, the second part will be both bold and red.

<Text style={{fontWeight: 'bold'}}> - I am bold - <Text style={{color: 'red'}}> - and red - </Text> -</Text>

We believe that this more constrained way to style text will yield better apps.

  • (Developper) React components are designed with strong isolation properties in mind, you should be able to drop a component anywhere in your application and it will look and behave the same way, as long as the props are the same. Having text properties be inherited from outside of the props breaks isolation.

  • (Implementor) The implementation of React Native is also simplified. We do not need to have a fontFamily field on every single element and we do not need to potentially traverse the tree up to the root every time we display a text node. The style inheritance is only encoded inside of the native Text component and doesn't leak to other components or the system itself.

\ No newline at end of file diff --git a/docs/textinput.html b/docs/textinput.html deleted file mode 100644 index 7e2f78582fc..00000000000 --- a/docs/textinput.html +++ /dev/null @@ -1,37 +0,0 @@ -React Native | Build Native Apps Using React

TextInput

A foundational component for inputting text into the app via a -keyboard. Props provide configurability for several features, such as auto- -correction, auto-capitalization, placeholder text, and different keyboard -types, such as a numeric keypad.

The simplest use case is to plop down a TextInput and subscribe to the -onChangeText events to read the user input. There are also other events, such -as onSubmitEditing and onFocus that can be subscribed to. A simple -example:

<View> - <TextInput - style={{height: 40, borderColor: 'gray', borderWidth: 1}} - onChangeText={(text) => this.setState({input: text})} - /> - <Text>{'user input: ' + this.state.input}</Text> -</View>

The value prop can be used to set the value of the input in order to make -the state of the component clear, but <TextInput> does not behave as a true -controlled component by default because all operations are asynchronous. -Setting value once is like setting the default value, but you can change it -continuously based on onChangeText events as well. If you really want to -force the component to always revert to the value you are setting, you can -set controlled={true}.

The multiline prop is not supported in all releases, and some props are -multiline only.

Props #

autoCapitalize enum('none', 'sentences', 'words', 'characters') #

Can tell TextInput to automatically capitalize certain characters.

  • characters: all characters,
  • words: first letter of each word
  • sentences: first letter of each sentence (default)
  • none: don't auto capitalize anything

autoCorrect bool #

If false, disables auto-correct. Default value is true.

autoFocus bool #

If true, focuses the input on componentDidMount. Default value is false.

bufferDelay number #

This helps avoid drops characters due to race conditions between JS and -the native text input. The default should be fine, but if you're -potentially doing very slow operations on every keystroke then you may -want to try increasing this.

clearButtonMode enum('never', 'while-editing', 'unless-editing', 'always') #

When the clear button should appear on the right side of the text view

controlled bool #

If you really want this to behave as a controlled component, you can set -this true, but you will probably see flickering, dropped keystrokes, -and/or laggy typing, depending on how you process onChange events.

editable bool #

If false, text is not editable. Default value is true.

keyboardType enum('default', 'numeric') #

Determines which keyboard to open, e.g.numeric.

multiline bool #

If true, the text input can be multiple lines. Default value is false.

onBlur func #

Callback that is called when the text input is blurred

onChangeText func #

(text: string) => void

Callback that is called when the text input's text changes.

onEndEditing func #

onFocus func #

Callback that is called when the text input is focused

onSubmitEditing func #

placeholder string #

The string that will be rendered before text input has been entered

placeholderTextColor string #

The text color of the placeholder string

selectionState DocumentSelectionState #

See DocumentSelectionState.js, some state that is responsible for -maintaining selection information for a document

style Text.propTypes.style #

value string #

The default value for the text input

\ No newline at end of file diff --git a/docs/timers.html b/docs/timers.html deleted file mode 100644 index d457d11db9a..00000000000 --- a/docs/timers.html +++ /dev/null @@ -1,28 +0,0 @@ -React Native | Build Native Apps Using React

Timers

Timers are an important part of an application and React Native implements the browser timers.

Timers #

  • setTimeout, clearTimeout
  • setInterval, clearInterval
  • setImmediate, clearImmediate
  • requestAnimationFrame, cancelAnimationFrame

requestAnimationFrame(fn) is the exact equivalent of setTimeout(fn, 0), they are triggered right after the screen has been flushed.

setImmediate is executed at the end of the current JavaScript execution block, right before sending the batched response back to native. Note that if you call setImmediate within a setImmediate callback, it will be executed right away, it won't yield back to native in between.

The Promise implementation uses setImmediate its asynchronicity primitive.

InteractionManager #

One reason why native apps feel so good performance wise is that barely any work is being done during an interaction/animation. In React Native, you can use InteractionManager that allows long-running work to be scheduled after any interactions/animations have completed.

Applications can schedule tasks to run after interactions with the following:

InteractionManager.runAfterInteractions(() => { - // ...long-running synchronous task... -});

Compare this to other scheduling alternatives:

  • requestAnimationFrame(): for code that animates a view over time.
  • setImmediate/setTimeout/setInterval(): run code later, note this may delay animations.
  • runAfterInteractions(): run code later, without delaying active animations.

The touch handling system considers one or more active touches to be an 'interaction' and will delay runAfterInteractions() callbacks until all touches have ended or been cancelled.

InteractionManager also allows applications to register animations by creating an interaction 'handle' on animation start, and clearing it upon completion:

var handle = InteractionManager.createInteractionHandle(); -// run animation... (`runAfterInteractions` tasks are queued) -// later, on animation completion: -InteractionManager.clearInteractionHandle(handle); -// queued tasks run if all handles were cleared

TimerMixin #

We found out that the primary cause of fatals in apps created with React Native was due to timers firing after a component was unmounted. To solve this recurring issue, we introduced TimerMixin. If you include TimerMixin, then you can replace your calls to setTimeout(fn, 500) with this.setTimeout(fn, 500) (just prepend this.) and everything will be properly cleaned up for you when the component unmounts.

var { TimerMixin } = React; - -var Component = React.createClass({ - mixins: [TimerMixin], - componentDidMount: function() { - this.setTimeout( - () => { console.log('I do not leak!'); }, - 500 - ); - } -});

We highly recommend never using bare timers and always using this mixin, it will save you from a lot of hard to track down bugs.

\ No newline at end of file diff --git a/docs/touchablehighlight.html b/docs/touchablehighlight.html deleted file mode 100644 index 65f0c43481d..00000000000 --- a/docs/touchablehighlight.html +++ /dev/null @@ -1,29 +0,0 @@ -React Native | Build Native Apps Using React

TouchableHighlight

A wrapper for making views respond properly to touches. -On press down, the opacity of the wrapped view is decreased, which allows -the underlay color to show through, darkening or tinting the view. The -underlay comes from adding a view to the view hierarchy, which can sometimes -cause unwanted visual artifacts if not used correctly, for example if the -backgroundColor of the wrapped view isn't explicitly set to an opaque color.

Example:

renderButton: function() { - return ( - <TouchableHighlight onPress={this._onPressButton}> - <Image - style={styles.button} - source={ix('myButton')} - /> - </View> - ); -},

Props #

activeOpacity number #

Determines what the opacity of the wrapped view should be when touch is -active.

onPress func #

Called when the touch is released, but not if cancelled (e.g. by -a scroll that steals the responder lock).

style View.propTypes.style #

underlayColor string #

The color of the underlay that will show through when the touch is -active.

\ No newline at end of file diff --git a/docs/touchableopacity.html b/docs/touchableopacity.html deleted file mode 100644 index 5da8b6c7c9d..00000000000 --- a/docs/touchableopacity.html +++ /dev/null @@ -1,25 +0,0 @@ -React Native | Build Native Apps Using React

TouchableOpacity

A wrapper for making views respond properly to touches. -On press down, the opacity of the wrapped view is decreased, dimming it. -This is done without actually changing the view hierarchy, and in general is -easy to add to an app without weird side-effects.

Example:

renderButton: function() { - return ( - <TouchableOpacity onPress={this._onPressButton}> - <Image - style={styles.button} - source={ix('myButton')} - /> - </View> - ); -},

Props #

activeOpacity number #

Determines what the opacity of the wrapped view should be when touch is -active.

\ No newline at end of file diff --git a/docs/touchablewithoutfeedback.html b/docs/touchablewithoutfeedback.html deleted file mode 100644 index f11b8383394..00000000000 --- a/docs/touchablewithoutfeedback.html +++ /dev/null @@ -1,14 +0,0 @@ -React Native | Build Native Apps Using React

TouchableWithoutFeedback

Do not use unless you have a very good reason. All the elements that -respond to press should have a visual feedback when touched. This is -one of the primary reason a "web" app doesn't feel "native".

Props #

\ No newline at end of file diff --git a/docs/view.html b/docs/view.html deleted file mode 100644 index 2ba82fe07b0..00000000000 --- a/docs/view.html +++ /dev/null @@ -1,47 +0,0 @@ -React Native | Build Native Apps Using React

View

The most fundamental component for building UI, View is a -container that supports layout with flexbox, style, some touch handling, and -accessibility controls, and is designed to be nested inside other views and -to have 0 to many children of any type. View maps directly to the native -view equivalent on whatever platform react is running on, whether that is a -UIView, <div>, android.view, etc. This example creates a View that -wraps two colored boxes and custom component in a row with padding.

<View style={{flexDirection: 'row', height: 100, padding: 20}}> - <View style={{backgroundColor: 'blue', flex: 0.3}} /> - <View style={{backgroundColor: 'red', flex: 0.5}} /> - <MyCustomComponent {...customProps} /> -</View>

By default, Views have a primary flex direction of 'column', so children -will stack up vertically by default. Views also expand to fill the parent -in the direction of the parent's flex direction by default, so in the case of -a default parent (flexDirection: 'column'), the children will fill the width, -but not the height.

Many library components can be treated like plain Views in many cases, for -example passing them children, setting style, etc.

Views are designed to be used with StyleSheets for clarity and -performance, although inline styles are also supported. It is common for -StyleSheets to be combined dynamically. See StyleSheet.js for more info.

Props #

accessible bool #

When true, indicates that the view is an accessibility element

onMoveShouldSetResponder func #

onResponderGrant func #

For most touch interactions, you'll simply want to wrap your component in -TouchableHighlight.js. Check out Touchable.js and -ScrollResponder.js for more discussion.

onResponderMove func #

onResponderReject func #

onResponderRelease func #

onResponderTerminate func #

onResponderTerminationRequest func #

onStartShouldSetResponder func #

onStartShouldSetResponderCapture func #

pointerEvents enum('box-none', 'none', 'box-only', 'auto') #

In the absence of auto property, none is much like CSS's none -value. box-none is as if you had applied the CSS class:

.cantTouchThis * { - pointer-events: auto; - } - .cantTouchThis { - pointer-events: none; - }

But since pointerEvents does not affect layout/appearance, and we are -already deviating from the spec by adding additional modes, we opt to not -include pointerEvents on style. On some platforms, we would need to -implement it as a className anyways. Using style or not is an -implementation detail of the platform.

removeClippedSubviews bool #

This is a special performance property exposed by RKView and is useful -for scrolling content when there are many subviews, most of which are -offscreen. For this property to be effective, it must be applied to a -view that contains many subviews that extend outside its bound. The -subviews must also have overflow: hidden, as should the containing view -(or one of its superviews).

style stylePropType #

Used to style and layout the View. See StyleSheet.js and -ViewStylePropTypes.js for more info.

testID string #

Used to locate this view in end-to-end tests.

\ No newline at end of file