From 3d5eba7a54eaedfcad85a0f3c799c4f4c84da4f4 Mon Sep 17 00:00:00 2001 From: Website Deployment Script Date: Tue, 24 May 2016 20:45:50 +0000 Subject: [PATCH] Updated docs for next --- releases/next/docs/platform-specific-code.html | 6 +++--- releases/next/docs/scrollview.html | 4 ++-- releases/next/showcase.html | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/releases/next/docs/platform-specific-code.html b/releases/next/docs/platform-specific-code.html index 60deafb2394..ada2cabe8a7 100644 --- a/releases/next/docs/platform-specific-code.html +++ b/releases/next/docs/platform-specific-code.html @@ -2,12 +2,12 @@ /android/components/ /ios/components/

Another option may be naming the components differently depending on the platform they are going to be used in:

BigButtonIOS.js BigButtonAndroid.js

But React Native provides two alternatives to easily organize your code separating it by platform:

Platform specific extensions #

React Native will detect when a file has a .ios. or .android. extension and load the right file for each platform when requiring them from other components.

For example, you can have these files in your project:

BigButton.ios.js -BigButton.android.js

With this setup, you can just require the files from a different component without paying attention to the platform in which the app will run.

import BigButton from './components/BigButton';

React Native will import the correct component for the running platform.

Platform module #

A module is provided by React Native to detect what is the platform in which the app is running. This piece of functionality can be useful when only small parts of a component are platform specific.

var { Platform } = React; +BigButton.android.js

With this setup, you can just require the files from a different component without paying attention to the platform in which the app will run.

import BigButton from './components/BigButton';

React Native will import the correct component for the running platform.

Platform module #

A module is provided by React Native to detect what is the platform in which the app is running. This piece of functionality can be useful when only small parts of a component are platform specific.

var { Platform } = ReactNative; var styles = StyleSheet.create({ height: (Platform.OS === 'ios') ? 200 : 100, });

Platform.OS will be ios when running in iOS and android when running in an Android device or simulator.

There is also a Platform.select method available, that given an object containing Platform.OS as keys, -returns the value for the platform you are currently running on.

var { Platform } = React; +returns the value for the platform you are currently running on.

var { Platform } = ReactNative; var styles = StyleSheet.create({ container: { @@ -27,7 +27,7 @@ on Android.

Since it accepts any value, you can also use it t android: () => require('ComponentAndroid'), })(); -<Component />;

Detecting Android version #

On Android, the Platform module can be also used to detect which is the version of the Android Platform in which the app is running

var {Platform} = React; +<Component />;

Detecting Android version #

On Android, the Platform module can be also used to detect which is the version of the Android Platform in which the app is running

var {Platform} = ReactNative; if(Platform.Version === 21){ console.log('Running on Lollipop!'); diff --git a/releases/next/docs/scrollview.html b/releases/next/docs/scrollview.html index a1dba63ea0d..08a1a8c7fda 100644 --- a/releases/next/docs/scrollview.html +++ b/releases/next/docs/scrollview.html @@ -70,7 +70,7 @@ for UIScrollViewDecelerationRateNormal and scrolling while dragging. The default value is false.

iosindicatorStyle enum('default', 'black', 'white') #

The style of the scroll indicators. - default (the default), same as black. - black, scroll indicator is black. This style is good against a white content background. - - white, scroll indicator is white. This style is good against a black content background.

iosmaximumZoomScale number #

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

iosminimumZoomScale number #

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

iosonRefreshStart function #

Deprecated

Use the refreshControl prop instead.

iosonScrollAnimationEnd function #

Called when a scrolling animation ends.

iosscrollEventThrottle number #

This controls how often the scroll event will be fired while scrolling + - white, scroll indicator is white. This style is good against a black content background.

iosmaximumZoomScale number #

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

iosminimumZoomScale number #

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

iosonScrollAnimationEnd function #

Called when a scrolling animation ends.

iosscrollEventThrottle number #

This controls how often the scroll event will be fired while scrolling (as a time interval in ms). A lower number yields better accuracy for code that is tracking the scroll position, but can lead to scroll performance problems due to the volume of information being send over the bridge. @@ -92,7 +92,7 @@ with snapToAlignment.

ioszoomScale number #

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

Methods #

endRefreshing() #

Deprecated. Use RefreshControl instead.

scrollTo(y: number | { x?: number, y?: number, animated?: boolean }, x: number, animated: boolean) #

Scrolls to a given x, y offset, either immediately or with a smooth animation.

Syntax:

scrollTo(options: {x: number = 0; y: number = 0; animated: boolean = true})

Note: The weird argument signature is due to the fact that, for historical reasons, +with horizontal={true}.

ioszoomScale number #

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

Methods #

scrollTo(y: number | { x?: number, y?: number, animated?: boolean }, x: number, animated: boolean) #

Scrolls to a given x, y offset, either immediately or with a smooth animation.

Syntax:

scrollTo(options: {x: number = 0; y: number = 0; animated: boolean = true})

Note: The weird argument signature is due to the fact that, for historical reasons, the function also accepts separate arguments as as alternative to the options object. This is deprecated due to ambiguity (y before x), and SHOULD NOT BE USED.

scrollWithoutAnimationTo(y, x) #

Deprecated, do not use.

Examples #

Edit on GitHub
'use strict'; diff --git a/releases/next/showcase.html b/releases/next/showcase.html index 5cad521ffc7..940d26733a9 100644 --- a/releases/next/showcase.html +++ b/releases/next/showcase.html @@ -1,4 +1,4 @@ -Showcase – React Native | A framework for building native apps using React

Apps using React Native

The following is a list of some of the public apps using React Native and are published on the Apple App Store or the Google Play Store. Not all are implemented 100% in React Native -- many are hybrid native/React Native. Can you tell which parts are which? :)

Want to add your app? Found an app that no longer works or no longer uses React Native? Please submit a pull request on GitHub to update this page!

Featured Apps

These are some of the most well-crafted React Native apps that we have come across.
Be sure to check them out to get a feel for what React Native is capable of!

All Apps

Not all apps can be featured, otherwise we would have to create some other category like "super featured" and that's just silly. But that doesn't mean you shouldn't check these apps out!

Azendoo

Azendoo

iOS · Android

By Azendoo

Blog post

Blueprint

Blueprint

iOS · Android

By Tom Hayden

breathe Meditation Timer

breathe Meditation Timer

iOS · Android

By idearockers UG

Bulut Filo Yönetimi

Bulut Filo Yönetimi

iOS · Android

By Macellan.net

CANDDi

CANDDi

iOS · Android

By CANDDi LTD.

Chemin de Fer de Provence

Chemin de Fer de Provence

iOS · Android

By Actigraph

Chillin'

Chillin'

iOS · Android

By Chillin LLC

DockMan

DockMan

iOS · Android

By Genki Takiuchi (s21g Inc.)

Blog post

DONUT chatrooms for communities

DONUT chatrooms for communities

iOS · Android

By Damien Brugne

Eat or Not

Eat or Not

iOS · Android

By Sharath Prabhal

Emoji Poetry

Emoji Poetry

iOS · Android

By forforce.com

Blog post

Fixt

Fixt

iOS · Android

By Fixt

HackerWeb

HackerWeb

iOS · Android

By Lim Chee Aun

Blog posts:

Hover

Hover

iOS · Android

By KevinEJohn

Kakapo

Kakapo

iOS · Android

By Daniel Levitt

MaxReward - Android

MaxReward - Android

iOS · Android

By Neil Ma

Mobabuild

Mobabuild

iOS · Android

By Sercan Demircan ( @sercanov )

Nabava.net

Nabava.net

iOS · Android

By Ars Futura

passpoints

passpoints

iOS · Android

By passpoints.de

Reach24

Reach24

iOS · Android

By Spritle Software

쉐어하우스

쉐어하우스

iOS · Android

By Dobbit Co., Ltd.

Spatula

Spatula

iOS · Android

By Kushal Dave

TeamWarden

TeamWarden

iOS · Android

By nittygritty.net

uSwitch - Energy switching app

uSwitch - Energy switching app

iOS · Android

By uSwitch Ltd

Video

Veckopengen – för barn och föräldrar

Veckopengen – för barn och föräldrar

iOS · Android

By Barnpengar AB

Video

Vorterix

Vorterix

iOS · Android

By Dift & underscope.io

WEARVR

WEARVR

iOS · Android

By WEARVR LLC

YAMU

YAMU

iOS · Android

By YAMU (Private) Limited (@yamulk)

天才段子手

天才段子手

iOS · Android

By Ran Zhao&Ji Zhao

うたよみん

うたよみん

iOS · Android

By Takayuki IMAI

© 2016 Facebook Inc.

Apps using React Native

The following is a list of some of the public apps using React Native and are published on the Apple App Store or the Google Play Store. Not all are implemented 100% in React Native -- many are hybrid native/React Native. Can you tell which parts are which? :)

Want to add your app? Found an app that no longer works or no longer uses React Native? Please submit a pull request on GitHub to update this page!

Featured Apps

These are some of the most well-crafted React Native apps that we have come across.
Be sure to check them out to get a feel for what React Native is capable of!

All Apps

Not all apps can be featured, otherwise we would have to create some other category like "super featured" and that's just silly. But that doesn't mean you shouldn't check these apps out!

Azendoo

Azendoo

iOS · Android

By Azendoo

Blog post

Blueprint

Blueprint

iOS · Android

By Tom Hayden

breathe Meditation Timer

breathe Meditation Timer

iOS · Android

By idearockers UG

Bulut Filo Yönetimi

Bulut Filo Yönetimi

iOS · Android

By Macellan.net

CANDDi

CANDDi

iOS · Android

By CANDDi LTD.

Chemin de Fer de Provence

Chemin de Fer de Provence

iOS · Android

By Actigraph

Chillin'

Chillin'

iOS · Android

By Chillin LLC

DockMan

DockMan

iOS · Android

By Genki Takiuchi (s21g Inc.)

Blog post

DONUT chatrooms for communities

DONUT chatrooms for communities

iOS · Android

By Damien Brugne

Eat or Not

Eat or Not

iOS · Android

By Sharath Prabhal

Emoji Poetry

Emoji Poetry

iOS · Android

By forforce.com

Blog post

Fixt

Fixt

iOS · Android

By Fixt

HackerWeb

HackerWeb

iOS · Android

By Lim Chee Aun

Blog posts:

Hover

Hover

iOS · Android

By KevinEJohn

Kakapo

Kakapo

iOS · Android

By Daniel Levitt

MaxReward - Android

MaxReward - Android

iOS · Android

By Neil Ma

Mobabuild

Mobabuild

iOS · Android

By Sercan Demircan ( @sercanov )

Nabava.net

Nabava.net

iOS · Android

By Ars Futura

NeoReader

NeoReader

iOS · Android

By Neo Nie

passpoints

passpoints

iOS · Android

By passpoints.de

Reach24

Reach24

iOS · Android

By Spritle Software

쉐어하우스

쉐어하우스

iOS · Android

By Dobbit Co., Ltd.

Spatula

Spatula

iOS · Android

By Kushal Dave

TeamWarden

TeamWarden

iOS · Android

By nittygritty.net

uSwitch - Energy switching app

uSwitch - Energy switching app

iOS · Android

By uSwitch Ltd

Video

Veckopengen – för barn och föräldrar

Veckopengen – för barn och föräldrar

iOS · Android

By Barnpengar AB

Video

Vorterix

Vorterix

iOS · Android

By Dift & underscope.io

WEARVR

WEARVR

iOS · Android

By WEARVR LLC

YAMU

YAMU

iOS · Android

By YAMU (Private) Limited (@yamulk)

天才段子手

天才段子手

iOS · Android

By Ran Zhao&Ji Zhao

うたよみん

うたよみん

iOS · Android

By Takayuki IMAI

© 2016 Facebook Inc.