ActionSheetIOS
Methods
-
-
showActionSheetWithOptions
-showShareActionSheetWithOptions
+showActionSheetWithOptions
+showShareActionSheetWithOptions
Reference
@@ -47,7 +47,7 @@destructiveButtonIndex (int) - index of destructive button in optionstitle (string) - a title to show above the action sheetmessage (string) - a message to show below the titletintColor (string) - the color used for non-destructive button titlestintColor (string) - the color used for non-destructive button titlesThe 'callback' function takes one parameter, the zero-based index of the selected item.
Minimal example:
diff --git a/docs/actionsheetios/index.html b/docs/actionsheetios/index.html index 0c6b4403da3..ac4a0766715 100644 --- a/docs/actionsheetios/index.html +++ b/docs/actionsheetios/index.html @@ -31,8 +31,8 @@ });ActionSheetIOS
Methods
-
-
showActionSheetWithOptions
-showShareActionSheetWithOptions
+showActionSheetWithOptions
+showShareActionSheetWithOptions
Reference
@@ -47,7 +47,7 @@destructiveButtonIndex (int) - index of destructive button in optionstitle (string) - a title to show above the action sheetmessage (string) - a message to show below the titletintColor (string) - the color used for non-destructive button titlestintColor (string) - the color used for non-destructive button titlesThe 'callback' function takes one parameter, the zero-based index of the selected item.
Minimal example:
diff --git a/docs/activityindicator.html b/docs/activityindicator.html index 71987f7878a..cde02242df1 100644 --- a/docs/activityindicator.html +++ b/docs/activityindicator.html @@ -70,13 +70,13 @@ AppRegistry.registerComponent('App', () => App)Props
Reference
@@ -99,7 +99,7 @@ AppRegistry.registerComponent('App', () => App)diff --git a/docs/activityindicator/index.html b/docs/activityindicator/index.html index 71987f7878a..cde02242df1 100644 --- a/docs/activityindicator/index.html +++ b/docs/activityindicator/index.html @@ -70,13 +70,13 @@ AppRegistry.registerComponent('App', () => App)
Props
Reference
@@ -99,7 +99,7 @@ AppRegistry.registerComponent('App', () => App)diff --git a/docs/alert.html b/docs/alert.html index 8bc4fdffc6d..28798c49588 100644 --- a/docs/alert.html +++ b/docs/alert.html @@ -73,7 +73,7 @@ Alert.alert(
Methods
Reference
diff --git a/docs/alert/index.html b/docs/alert/index.html index 8bc4fdffc6d..28798c49588 100644 --- a/docs/alert/index.html +++ b/docs/alert/index.html @@ -73,7 +73,7 @@ Alert.alert(Methods
Reference
diff --git a/docs/alertios.html b/docs/alertios.html index 764e4abb59d..55276240cba 100644 --- a/docs/alertios.html +++ b/docs/alertios.html @@ -43,17 +43,17 @@ text => console.log("You entered "+text) ); -We recommend using the Alert.alert method for cross-platform support if you don't need to create iOS-only prompts.
We recommend using the Alert.alert method for cross-platform support if you don't need to create iOS-only prompts.
Methods
Type Definitions
Reference
@@ -70,8 +70,8 @@text key, as well as optional onPress and style keys. style should be one of 'default', 'cancel' or 'destructive'.text key, as well as optional onPress and style keys. style should be one of 'default', 'cancel' or 'destructive'.Example with custom buttons:
@@ -104,8 +104,8 @@text key, as well as optional onPress and style keys (see example). style should be one of 'default', 'cancel' or 'destructive'.text key, as well as optional onPress and style keys (see example). style should be one of 'default', 'cancel' or 'destructive'.Constants:
diff --git a/docs/alertios/index.html b/docs/alertios/index.html index 764e4abb59d..55276240cba 100644 --- a/docs/alertios/index.html +++ b/docs/alertios/index.html @@ -43,17 +43,17 @@ text => console.log("You entered "+text) ); -We recommend using the Alert.alert method for cross-platform support if you don't need to create iOS-only prompts.
We recommend using the Alert.alert method for cross-platform support if you don't need to create iOS-only prompts.
Methods
Type Definitions
Reference
@@ -70,8 +70,8 @@text key, as well as optional onPress and style keys. style should be one of 'default', 'cancel' or 'destructive'.text key, as well as optional onPress and style keys. style should be one of 'default', 'cancel' or 'destructive'.Example with custom buttons:
@@ -104,8 +104,8 @@text key, as well as optional onPress and style keys (see example). style should be one of 'default', 'cancel' or 'destructive'.text key, as well as optional onPress and style keys (see example). style should be one of 'default', 'cancel' or 'destructive'.Constants:
diff --git a/docs/animated.html b/docs/animated.html index 6a93981dfc0..5ed18bf81c3 100644 --- a/docs/animated.html +++ b/docs/animated.html @@ -39,31 +39,31 @@ } ).start(); // Start the animation -Refer to the Animations guide to see additional examples of Animated in action.
Refer to the Animations guide to see additional examples of Animated in action.
Overview
There are two value types you can use with Animated:
-
-
Animated.Value()for single values
-Animated.ValueXY()for vectors
+Animated.Value()for single values
+Animated.ValueXY()for vectors
Animated.Value can bind to style properties or other props, and can be interpolated as well. A single Animated.Value can drive any number of properties.
Configuring animations
Animated provides three types of animation types. Each animation type provides a particular animation curve that controls how your values animate from their initial value to the final value:
-
-
Animated.decay()starts with an initial velocity and gradually slows to a stop.
-Animated.spring()provides a simple spring physics model.
-Animated.timing()animates a value over time using easing functions.
+Animated.decay()starts with an initial velocity and gradually slows to a stop.
+Animated.spring()provides a simple spring physics model.
+Animated.timing()animates a value over time using easing functions.
In most cases, you will be using timing(). By default, it uses a symmetric easeInOut curve that conveys the gradual acceleration of an object to full speed and concludes by gradually decelerating to a stop.
Working with animations
Animations are started by calling start() on your animation. start() takes a completion callback that will be called when the animation is done. If the animation finished running normally, the completion callback will be invoked with {finished: true}. If the animation is done because stop() was called on it before it could finish (e.g. because it was interrupted by a gesture or another animation), then it will receive {finished: false}.
Using the native driver
By using the native driver, we send everything about the animation to native before starting the animation, allowing native code to perform the animation on the UI thread without having to go through the bridge on every frame. Once the animation has started, the JS thread can be blocked without affecting the animation.
-You can use the native driver by specifying useNativeDriver: true in your animation configuration. See the Animations guide to learn more.
You can use the native driver by specifying useNativeDriver: true in your animation configuration. See the Animations guide to learn more.
Animatable components
Only animatable components can be animated. These special components do the magic of binding the animated values to the properties, and do targeted native updates to avoid the cost of the react render and reconciliation process on every frame. They also handle cleanup on unmount so they are safe by default.
-
-
createAnimatedComponent()can be used to make a component animatable.
+createAnimatedComponent()can be used to make a component animatable.
Animated exports the following animatable components using the above wrapper:
-
@@ -75,32 +75,32 @@
Animated.delay()starts an animation after a given delay.
-Animated.parallel()starts a number of animations at the same time.
-Animated.sequence()starts the animations in order, waiting for each to complete before starting the next.
-Animated.stagger()starts animations in order and in parallel, but with successive delays.
+Animated.delay()starts an animation after a given delay.
+Animated.parallel()starts a number of animations at the same time.
+Animated.sequence()starts the animations in order, waiting for each to complete before starting the next.
+Animated.stagger()starts animations in order and in parallel, but with successive delays.Animated.add()
-Animated.subtract()
-Animated.divide()
-Animated.modulo()
-Animated.multiply()
+Animated.add()
+Animated.subtract()
+Animated.divide()
+Animated.modulo()
+Animated.multiply()
Composing animations
Animations can also be combined in complex ways using composition functions:
-
-
Animations can also be chained together simply by setting the toValue of one animation to be another Animated.Value. See Tracking dynamic values in the Animations guide.
Animations can also be chained together simply by setting the toValue of one animation to be another Animated.Value. See Tracking dynamic values in the Animations guide.
By default, if one animation is stopped or interrupted, then all other animations in the group are also stopped.
Combining animated values
You can combine two animated values via addition, subtraction, multiplication, division, or modulo to make a new animated value:
-
-
Interpolation
The interpolate() function allows input ranges to map to different output ranges. By default, it will extrapolate the curve beyond the ranges given, but you can also have it clamp the output value. It uses lineal interpolation by default but also supports easing functions.
Read more about interpolation in the Animation guide.
+Read more about interpolation in the Animation guide.
Handling gestures and other events
Gestures, like panning or scrolling, and other events can map directly to animated values using Animated.event(). This is done with a structured map syntax so that values can be extracted from complex event objects. The first level is an array to allow mapping across multiple args, and that array contains nested objects.
For example, when working with horizontal scrolling gestures, you would do the following in order to map event.nativeEvent.contentOffset.x to scrollX (an Animated.Value):
onScroll={Animated.event(
@@ -115,32 +115,32 @@
Methods
-
-
decay
-timing
-spring
-add
-subtract
-divide
-multiply
-modulo
-diffClamp
-delay
-sequence
-parallel
-stagger
-loop
-event
-forkEvent
-unforkEvent
+decay
+timing
+spring
+add
+subtract
+divide
+multiply
+modulo
+diffClamp
+delay
+sequence
+parallel
+stagger
+loop
+event
+forkEvent
+unforkEvent
Properties
-
-
Value
-ValueXY
-Interpolation
-Node
-createAnimatedComponent
-attachNativeEvent
+Value
+ValueXY
+Interpolation
+Node
+createAnimatedComponent
+attachNativeEvent
Reference
@@ -161,7 +161,7 @@timing()
static timing(value, config)
-Animates a value along a timed easing curve. The Easing module has tons of predefined curves, or you can use your own function.
Animates a value along a timed easing curve. The Easing module has tons of predefined curves, or you can use your own function.
Config is an object that may have the following options:
duration: Length of animation (milliseconds). Default 500.
diff --git a/docs/animated/index.html b/docs/animated/index.html
index 6a93981dfc0..5ed18bf81c3 100644
--- a/docs/animated/index.html
+++ b/docs/animated/index.html
@@ -39,31 +39,31 @@
}
).start(); // Start the animation
-Animated.Value()for single values
-Animated.ValueXY()for vectors
+Animated.Value()for single values
+Animated.ValueXY()for vectorsAnimated.decay()starts with an initial velocity and gradually slows to a stop.
-Animated.spring()provides a simple spring physics model.
-Animated.timing()animates a value over time using easing functions.
+Animated.decay()starts with an initial velocity and gradually slows to a stop.
+Animated.spring()provides a simple spring physics model.
+Animated.timing()animates a value over time using easing functions.createAnimatedComponent()can be used to make a component animatable.
+createAnimatedComponent()can be used to make a component animatable.Animated.delay()starts an animation after a given delay.
-Animated.parallel()starts a number of animations at the same time.
-Animated.sequence()starts the animations in order, waiting for each to complete before starting the next.
-Animated.stagger()starts animations in order and in parallel, but with successive delays.
+Animated.delay()starts an animation after a given delay.
+Animated.parallel()starts a number of animations at the same time.
+Animated.sequence()starts the animations in order, waiting for each to complete before starting the next.
+Animated.stagger()starts animations in order and in parallel, but with successive delays.Animated.add()
-Animated.subtract()
-Animated.divide()
-Animated.modulo()
-Animated.multiply()
+Animated.add()
+Animated.subtract()
+Animated.divide()
+Animated.modulo()
+Animated.multiply()
Refer to the Animations guide to see additional examples of Animated in action.
Refer to the Animations guide to see additional examples of Animated in action.
Overview
There are two value types you can use with Animated:
-
-
Animated.Value can bind to style properties or other props, and can be interpolated as well. A single Animated.Value can drive any number of properties.
Configuring animations
Animated provides three types of animation types. Each animation type provides a particular animation curve that controls how your values animate from their initial value to the final value:
-
-
In most cases, you will be using timing(). By default, it uses a symmetric easeInOut curve that conveys the gradual acceleration of an object to full speed and concludes by gradually decelerating to a stop.
Working with animations
Animations are started by calling start() on your animation. start() takes a completion callback that will be called when the animation is done. If the animation finished running normally, the completion callback will be invoked with {finished: true}. If the animation is done because stop() was called on it before it could finish (e.g. because it was interrupted by a gesture or another animation), then it will receive {finished: false}.
Using the native driver
By using the native driver, we send everything about the animation to native before starting the animation, allowing native code to perform the animation on the UI thread without having to go through the bridge on every frame. Once the animation has started, the JS thread can be blocked without affecting the animation.
-You can use the native driver by specifying useNativeDriver: true in your animation configuration. See the Animations guide to learn more.
You can use the native driver by specifying useNativeDriver: true in your animation configuration. See the Animations guide to learn more.
Animatable components
Only animatable components can be animated. These special components do the magic of binding the animated values to the properties, and do targeted native updates to avoid the cost of the react render and reconciliation process on every frame. They also handle cleanup on unmount so they are safe by default.
-
-
Animated exports the following animatable components using the above wrapper:
-
@@ -75,32 +75,32 @@
Composing animations
Animations can also be combined in complex ways using composition functions:
-
-
Animations can also be chained together simply by setting the toValue of one animation to be another Animated.Value. See Tracking dynamic values in the Animations guide.
Animations can also be chained together simply by setting the toValue of one animation to be another Animated.Value. See Tracking dynamic values in the Animations guide.
By default, if one animation is stopped or interrupted, then all other animations in the group are also stopped.
Combining animated values
You can combine two animated values via addition, subtraction, multiplication, division, or modulo to make a new animated value:
-
-
Interpolation
The interpolate() function allows input ranges to map to different output ranges. By default, it will extrapolate the curve beyond the ranges given, but you can also have it clamp the output value. It uses lineal interpolation by default but also supports easing functions.
Read more about interpolation in the Animation guide.
+Read more about interpolation in the Animation guide.
Handling gestures and other events
Gestures, like panning or scrolling, and other events can map directly to animated values using Animated.event(). This is done with a structured map syntax so that values can be extracted from complex event objects. The first level is an array to allow mapping across multiple args, and that array contains nested objects.
For example, when working with horizontal scrolling gestures, you would do the following in order to map event.nativeEvent.contentOffset.x to scrollX (an Animated.Value):
onScroll={Animated.event(
@@ -115,32 +115,32 @@
Methods
-
-
decay
-timing
-spring
-add
-subtract
-divide
-multiply
-modulo
-diffClamp
-delay
-sequence
-parallel
-stagger
-loop
-event
-forkEvent
-unforkEvent
+decay
+timing
+spring
+add
+subtract
+divide
+multiply
+modulo
+diffClamp
+delay
+sequence
+parallel
+stagger
+loop
+event
+forkEvent
+unforkEvent
Properties
-
-
Value
-ValueXY
-Interpolation
-Node
-createAnimatedComponent
-attachNativeEvent
+Value
+ValueXY
+Interpolation
+Node
+createAnimatedComponent
+attachNativeEvent
Reference
@@ -161,7 +161,7 @@timing()
static timing(value, config)
-Animates a value along a timed easing curve. The Easing module has tons of predefined curves, or you can use your own function.
Animates a value along a timed easing curve. The Easing module has tons of predefined curves, or you can use your own function.
Config is an object that may have the following options:
duration: Length of animation (milliseconds). Default 500.
diff --git a/docs/animatedvalue.html b/docs/animatedvalue.html
index ddab537c6a3..7d20b2f55da 100644
--- a/docs/animatedvalue.html
+++ b/docs/animatedvalue.html
@@ -8,22 +8,22 @@
ga('send', 'pageview');
setValue
-setOffset
-flattenOffset
-extractOffset
-addListener
-removeListener
-removeAllListeners
-stopAnimation
-resetAnimation
-interpolate
-animate
-stopTracking
-track
+setValue
+setOffset
+flattenOffset
+extractOffset
+addListener
+removeListener
+removeAllListeners
+stopAnimation
+resetAnimation
+interpolate
+animate
+stopTracking
+tracksetValue
-setOffset
-flattenOffset
-extractOffset
-addListener
-removeListener
-removeAllListeners
-stopAnimation
-resetAnimation
-interpolate
-animate
-stopTracking
-track
+setValue
+setOffset
+flattenOffset
+extractOffset
+addListener
+removeListener
+removeAllListeners
+stopAnimation
+resetAnimation
+interpolate
+animate
+stopTracking
+tracksetValue
-setOffset
-flattenOffset
-extractOffset
-addListener
-removeListener
-removeAllListeners
-stopAnimation
-resetAnimation
-getLayout
-getTranslateTransform
+setValue
+setOffset
+flattenOffset
+extractOffset
+addListener
+removeListener
+removeAllListeners
+stopAnimation
+resetAnimation
+getLayout
+getTranslateTransformsetValue
-setOffset
-flattenOffset
-extractOffset
-addListener
-removeListener
-removeAllListeners
-stopAnimation
-resetAnimation
-getLayout
-getTranslateTransform
+setValue
+setOffset
+flattenOffset
+extractOffset
+addListener
+removeListener
+removeAllListeners
+stopAnimation
+resetAnimation
+getLayout
+getTranslateTransformonPress
-title
-accessibilityLabel
-color
-disabled
-testID
-hasTVPreferredFocus
+onPress
+title
+accessibilityLabel
+color
+disabled
+testID
+hasTVPreferredFocusonPress
-title
-accessibilityLabel
-color
-disabled
-testID
-hasTVPreferredFocus
+onPress
+title
+accessibilityLabel
+color
+disabled
+testID
+hasTVPreferredFocus- As events can be sent from anywhere, they can introduce spaghetti-style dependencies into your project. @@ -88,7 +88,7 @@ mReactRootView.setAppProperties(updatedProps);
- If you use several instances of the same React Native component and you want to distinguish them from the perspective of your event, you'll likely need to introduce identifiers and pass them along with events (you can use the native view's
reactTagas an identifier). - As events can be sent from anywhere, they can introduce spaghetti-style dependencies into your project. @@ -88,7 +88,7 @@ mReactRootView.setAppProperties(updatedProps);
- If you use several instances of the same React Native component and you want to distinguish them from the perspective of your event, you'll likely need to introduce identifiers and pass them along with events (you can use the native view's
reactTagas an identifier). - As events can be sent from anywhere, they can introduce spaghetti-style dependencies into your project. @@ -100,7 +100,7 @@ rootView.appProperties = @{Calling native functions from React Native (native modules) -
- As events can be sent from anywhere, they can introduce spaghetti-style dependencies into your project. @@ -100,7 +100,7 @@ rootView.appProperties = @{Calling native functions from React Native (native modules) -
- Basic Components -
- User Interface -
- List Views -
- iOS-specific -
- Android-specific -
- Others +
- Basic Components +
- User Interface +
- List Views +
- iOS-specific +
- Android-specific +
- Others
- Basic Components -
- User Interface -
- List Views -
- iOS-specific -
- Android-specific -
- Others +
- Basic Components +
- User Interface +
- List Views +
- iOS-specific +
- Android-specific +
- Others
date
-onDateChange
-maximumDate
-minimumDate
-minuteInterval
-mode
-locale
-timeZoneOffsetInMinutes
+date
+onDateChange
+maximumDate
+minimumDate
+minuteInterval
+mode
+locale
+timeZoneOffsetInMinutesdate
-onDateChange
-maximumDate
-minimumDate
-minuteInterval
-mode
-locale
-timeZoneOffsetInMinutes
+date
+onDateChange
+maximumDate
+minimumDate
+minuteInterval
+mode
+locale
+timeZoneOffsetInMinutes- pageX
- pageY -
- pageX
- pageY -
renderNavigationView
-onDrawerClose
-drawerPosition
-drawerWidth
-keyboardDismissMode
-drawerLockMode
-onDrawerOpen
-onDrawerSlide
-onDrawerStateChanged
-drawerBackgroundColor
-statusBarBackgroundColor
+renderNavigationView
+onDrawerClose
+drawerPosition
+drawerWidth
+keyboardDismissMode
+drawerLockMode
+onDrawerOpen
+onDrawerSlide
+onDrawerStateChanged
+drawerBackgroundColor
+statusBarBackgroundColorrenderNavigationView
-onDrawerClose
-drawerPosition
-drawerWidth
-keyboardDismissMode
-drawerLockMode
-onDrawerOpen
-onDrawerSlide
-onDrawerStateChanged
-drawerBackgroundColor
-statusBarBackgroundColor
+renderNavigationView
+onDrawerClose
+drawerPosition
+drawerWidth
+keyboardDismissMode
+drawerLockMode
+onDrawerOpen
+onDrawerSlide
+onDrawerStateChanged
+drawerBackgroundColor
+statusBarBackgroundColorbackprovides a simple animation where the object goes slightly back before moving forward
-bounceprovides a bouncing animation
-easeprovides a simple inertial animation
-elasticprovides a simple spring interaction
+backprovides a simple animation where the object goes slightly back before moving forward
+bounceprovides a bouncing animation
+easeprovides a simple inertial animation
+elasticprovides a simple spring interactionbezierprovides a cubic bezier curve
-circleprovides a circular function
-sinprovides a sinusoidal function
-expprovides an exponential function
+bezierprovides a cubic bezier curve
+circleprovides a circular function
+sinprovides a sinusoidal function
+expprovides an exponential functioninruns an easing function forwards
-inOutmakes any easing function symmetrical
-outruns an easing function backwards
+inruns an easing function forwards
+inOutmakes any easing function symmetrical
+outruns an easing function backwardsstep0
-step1
-linear
-ease
-quad
-cubic
-poly
-sin
-circle
-exp
-elastic
-back
-bounce
-bezier
-in
-out
-inOut
+step0
+step1
+linear
+ease
+quad
+cubic
+poly
+sin
+circle
+exp
+elastic
+back
+bounce
+bezier
+in
+out
+inOutbackprovides a simple animation where the object goes slightly back before moving forward
-bounceprovides a bouncing animation
-easeprovides a simple inertial animation
-elasticprovides a simple spring interaction
+backprovides a simple animation where the object goes slightly back before moving forward
+bounceprovides a bouncing animation
+easeprovides a simple inertial animation
+elasticprovides a simple spring interactionbezierprovides a cubic bezier curve
-circleprovides a circular function
-sinprovides a sinusoidal function
-expprovides an exponential function
+bezierprovides a cubic bezier curve
+circleprovides a circular function
+sinprovides a sinusoidal function
+expprovides an exponential functioninruns an easing function forwards
-inOutmakes any easing function symmetrical
-outruns an easing function backwards
+inruns an easing function forwards
+inOutmakes any easing function symmetrical
+outruns an easing function backwardsstep0
-step1
-linear
-ease
-quad
-cubic
-poly
-sin
-circle
-exp
-elastic
-back
-bounce
-bezier
-in
-out
-inOut
+step0
+step1
+linear
+ease
+quad
+cubic
+poly
+sin
+circle
+exp
+elastic
+back
+bounce
+bezier
+in
+out
+inOut- Scroll loading.
- ScrollToIndex support. -
- Internal state is not preserved when content scrolls out of the render window. Make sure all your data is captured in the item data or external stores like Flux, Redux, or Relay.
- This is a
PureComponentwhich means that it will not re-render ifpropsremain shallow- equal. Make sure that everything yourrenderItemfunction depends on is passed as a prop (e.g.extraData) that is not===after updates, otherwise your UI may not update on changes. This includes thedataprop and parent component state. - In order to constrain memory and enable smooth scrolling, content is rendered asynchronously offscreen. This means it's possible to scroll faster than the fill rate and momentarily see blank content. This is a tradeoff that can be adjusted to suit the needs of each application, and we are working on improving it behind the scenes.
- By default, the list looks for a
keyprop on each item and uses that for the React key. Alternatively, you can provide a customkeyExtractorprop. ScrollViewprops...
-VirtualizedListprops...
-renderItem
-data
-ItemSeparatorComponent
-ListEmptyComponent
-ListFooterComponent
-ListHeaderComponent
-columnWrapperStyle
-extraData
-getItemLayout
-horizontal
-initialNumToRender
-initialScrollIndex
-inverted
-keyExtractor
-numColumns
-onEndReached
-onEndReachedThreshold
-onRefresh
-onViewableItemsChanged
-progressViewOffset
-legacyImplementation
-refreshing
-removeClippedSubviews
-viewabilityConfig
-viewabilityConfigCallbackPairs
+ScrollViewprops...
+VirtualizedListprops...
+renderItem
+data
+ItemSeparatorComponent
+ListEmptyComponent
+ListFooterComponent
+ListHeaderComponent
+columnWrapperStyle
+extraData
+getItemLayout
+horizontal
+initialNumToRender
+initialScrollIndex
+inverted
+keyExtractor
+numColumns
+onEndReached
+onEndReachedThreshold
+onRefresh
+onViewableItemsChanged
+progressViewOffset
+legacyImplementation
+refreshing
+removeClippedSubviews
+viewabilityConfig
+viewabilityConfigCallbackPairsscrollToEnd
-scrollToIndex
-scrollToItem
-scrollToOffset
-recordInteraction
-flashScrollIndicators
+scrollToEnd
+scrollToIndex
+scrollToItem
+scrollToOffset
+recordInteraction
+flashScrollIndicators- Scroll loading.
- ScrollToIndex support. -
- Internal state is not preserved when content scrolls out of the render window. Make sure all your data is captured in the item data or external stores like Flux, Redux, or Relay.
- This is a
PureComponentwhich means that it will not re-render ifpropsremain shallow- equal. Make sure that everything yourrenderItemfunction depends on is passed as a prop (e.g.extraData) that is not===after updates, otherwise your UI may not update on changes. This includes thedataprop and parent component state. - In order to constrain memory and enable smooth scrolling, content is rendered asynchronously offscreen. This means it's possible to scroll faster than the fill rate and momentarily see blank content. This is a tradeoff that can be adjusted to suit the needs of each application, and we are working on improving it behind the scenes.
- By default, the list looks for a
keyprop on each item and uses that for the React key. Alternatively, you can provide a customkeyExtractorprop. ScrollViewprops...
-VirtualizedListprops...
-renderItem
-data
-ItemSeparatorComponent
-ListEmptyComponent
-ListFooterComponent
-ListHeaderComponent
-columnWrapperStyle
-extraData
-getItemLayout
-horizontal
-initialNumToRender
-initialScrollIndex
-inverted
-keyExtractor
-numColumns
-onEndReached
-onEndReachedThreshold
-onRefresh
-onViewableItemsChanged
-progressViewOffset
-legacyImplementation
-refreshing
-removeClippedSubviews
-viewabilityConfig
-viewabilityConfigCallbackPairs
+ScrollViewprops...
+VirtualizedListprops...
+renderItem
+data
+ItemSeparatorComponent
+ListEmptyComponent
+ListFooterComponent
+ListHeaderComponent
+columnWrapperStyle
+extraData
+getItemLayout
+horizontal
+initialNumToRender
+initialScrollIndex
+inverted
+keyExtractor
+numColumns
+onEndReached
+onEndReachedThreshold
+onRefresh
+onViewableItemsChanged
+progressViewOffset
+legacyImplementation
+refreshing
+removeClippedSubviews
+viewabilityConfig
+viewabilityConfigCallbackPairsscrollToEnd
-scrollToIndex
-scrollToItem
-scrollToOffset
-recordInteraction
-flashScrollIndicators
+scrollToEnd
+scrollToIndex
+scrollToItem
+scrollToOffset
+recordInteraction
+flashScrollIndicatorsGenerally, you can use TouchableHighlight anywhere you would use a button or link on web. The view's background will be darkened when the user presses down on the button.
-You may consider using TouchableNativeFeedback on Android to display ink surface reaction ripples that respond to the user's touch.
-TouchableOpacity can be used to provide feedback by reducing the opacity of the button, allowing the background to be seen through while the user is pressing down.
-If you need to handle a tap gesture but you don't want any feedback to be displayed, use TouchableWithoutFeedback.
+Generally, you can use TouchableHighlight anywhere you would use a button or link on web. The view's background will be darkened when the user presses down on the button.
+You may consider using TouchableNativeFeedback on Android to display ink surface reaction ripples that respond to the user's touch.
+TouchableOpacity can be used to provide feedback by reducing the opacity of the button, allowing the background to be seen through while the user is pressing down.
+If you need to handle a tap gesture but you don't want any feedback to be displayed, use TouchableWithoutFeedback.
Generally, you can use TouchableHighlight anywhere you would use a button or link on web. The view's background will be darkened when the user presses down on the button.
-You may consider using TouchableNativeFeedback on Android to display ink surface reaction ripples that respond to the user's touch.
-TouchableOpacity can be used to provide feedback by reducing the opacity of the button, allowing the background to be seen through while the user is pressing down.
-If you need to handle a tap gesture but you don't want any feedback to be displayed, use TouchableWithoutFeedback.
+Generally, you can use TouchableHighlight anywhere you would use a button or link on web. The view's background will be darkened when the user presses down on the button.
+You may consider using TouchableNativeFeedback on Android to display ink surface reaction ripples that respond to the user's touch.
+TouchableOpacity can be used to provide feedback by reducing the opacity of the button, allowing the background to be seen through while the user is pressing down.
+If you need to handle a tap gesture but you don't want any feedback to be displayed, use TouchableWithoutFeedback.
borderTopRightRadius
-backfaceVisibility
-borderBottomLeftRadius
-borderBottomRightRadius
-borderColor
-borderRadius
-borderTopLeftRadius
-backgroundColor
-borderWidth
-opacity
-overflow
-resizeMode
-tintColor
-overlayColor
+borderTopRightRadius
+backfaceVisibility
+borderBottomLeftRadius
+borderBottomRightRadius
+borderColor
+borderRadius
+borderTopLeftRadius
+backgroundColor
+borderWidth
+opacity
+overflow
+resizeMode
+tintColor
+overlayColorborderTopRightRadius
-backfaceVisibility
-borderBottomLeftRadius
-borderBottomRightRadius
-borderColor
-borderRadius
-borderTopLeftRadius
-backgroundColor
-borderWidth
-opacity
-overflow
-resizeMode
-tintColor
-overlayColor
+borderTopRightRadius
+backfaceVisibility
+borderBottomLeftRadius
+borderBottomRightRadius
+borderColor
+borderRadius
+borderTopLeftRadius
+backgroundColor
+borderWidth
+opacity
+overflow
+resizeMode
+tintColor
+overlayColorstyle
-blurRadius
-onLayout
-onLoad
-onLoadEnd
-onLoadStart
-resizeMode
-source
-loadingIndicatorSource
-onError
-testID
-resizeMethod
-accessibilityLabel
-accessible
-capInsets
-defaultSource
-onPartialLoad
-onProgress
-fadeDuration
+style
+blurRadius
+onLayout
+onLoad
+onLoadEnd
+onLoadStart
+resizeMode
+source
+loadingIndicatorSource
+onError
+testID
+resizeMethod
+accessibilityLabel
+accessible
+capInsets
+defaultSource
+onPartialLoad
+onProgress
+fadeDurationgetSize
-prefetch
-abortPrefetch
-queryCache
-resolveAssetSource
+getSize
+prefetch
+abortPrefetch
+queryCache
+resolveAssetSource- -
- -
- +
- +
- +
borderTopRightRadius: numberbackfaceVisibility: enum('visible', 'hidden')borderBottomLeftRadius: numberborderBottomRightRadius: number
-borderColor: color
+borderColor: colorborderRadius: numberborderTopLeftRadius: number
-backgroundColor: color
+backgroundColor: colorborderWidth: numberopacity: numberoverflow: enum('visible', 'hidden')resizeMode: Object.keys(ImageResizeMode)
-
+tintColor: colortintColor: colorChanges the color of all the non-transparent pixels to the tintColor.
overlayColor: string (Android)When the image has rounded corners, specifying an overlayColor will cause the remaining space in the corners to be filled with a solid color. This is useful in cases which are not supported by the Android implementation of rounded corners:
diff --git a/docs/image/index.html b/docs/image/index.html index 37b49c64d11..c7c3a8de19f 100644 --- a/docs/image/index.html +++ b/docs/image/index.html @@ -112,33 +112,33 @@ AppRegistry.registerComponent(Props
-
-
style
-blurRadius
-onLayout
-onLoad
-onLoadEnd
-onLoadStart
-resizeMode
-source
-loadingIndicatorSource
-onError
-testID
-resizeMethod
-accessibilityLabel
-accessible
-capInsets
-defaultSource
-onPartialLoad
-onProgress
-fadeDuration
+style
+blurRadius
+onLayout
+onLoad
+onLoadEnd
+onLoadStart
+resizeMode
+source
+loadingIndicatorSource
+onError
+testID
+resizeMethod
+accessibilityLabel
+accessible
+capInsets
+defaultSource
+onPartialLoad
+onProgress
+fadeDuration
Methods
-
-
getSize
-prefetch
-abortPrefetch
-queryCache
-resolveAssetSource
+getSize
+prefetch
+abortPrefetch
+queryCache
+resolveAssetSource
Reference
@@ -154,22 +154,22 @@ AppRegistry.registerComponent(-
-
- -
- -
- +
- +
- +
borderTopRightRadius: numberbackfaceVisibility: enum('visible', 'hidden')borderBottomLeftRadius: numberborderBottomRightRadius: number
-borderColor: color
+borderColor: colorborderRadius: numberborderTopLeftRadius: number
-backgroundColor: color
+backgroundColor: colorborderWidth: numberopacity: numberoverflow: enum('visible', 'hidden')resizeMode: Object.keys(ImageResizeMode)
-
+tintColor: colortintColor: colorChanges the color of all the non-transparent pixels to the tintColor.
overlayColor: string (Android)When the image has rounded corners, specifying an overlayColor will cause the remaining space in the corners to be filled with a solid color. This is useful in cases which are not supported by the Android implementation of rounded corners:
diff --git a/docs/imageeditor.html b/docs/imageeditor.html index 4a4d4219276..1dc71922dbd 100644 --- a/docs/imageeditor.html +++ b/docs/imageeditor.html @@ -31,7 +31,7 @@ });
canRecordVideos
-canUseCamera
-openCameraDialog
-openSelectDialog
+canRecordVideos
+canUseCamera
+openCameraDialog
+openSelectDialogcanRecordVideos
-canUseCamera
-openCameraDialog
-openSelectDialog
+canRecordVideos
+canUseCamera
+openCameraDialog
+openSelectDialoghasImageForTag
-removeImageForTag
-addImageFromBase64
-getBase64ForTag
+hasImageForTag
+removeImageForTag
+addImageFromBase64
+getBase64ForTaghasImageForTag
-removeImageForTag
-addImageFromBase64
-getBase64ForTag
+hasImageForTag
+removeImageForTag
+addImageFromBase64
+getBase64ForTag- Choose keyboard type (e.g. email, numeric)
- Make sure the return button focuses the next field or submits the form -
- Choose keyboard type (e.g. email, numeric)
- Make sure the return button focuses the next field or submits the form -
alignContent
-alignItems
-alignSelf
-aspectRatio
-borderBottomWidth
-borderEndWidth
-borderLeftWidth
-borderRightWidth
-borderStartWidth
-borderTopWidth
-borderWidth
-bottom
-direction
-display
-end
-flex
-flexBasis
-flexDirection
-flexGrow
-flexShrink
-flexWrap
-height
-justifyContent
-left
-margin
-marginBottom
-marginEnd
-marginHorizontal
-marginLeft
-marginRight
-marginStart
-marginTop
-marginVertical
-maxHeight
-maxWidth
-minHeight
-minWidth
-overflow
-padding
-paddingBottom
-paddingEnd
-paddingHorizontal
-paddingLeft
-paddingRight
-paddingStart
-paddingTop
-paddingVertical
-position
-right
-start
-top
-width
-zIndex
+alignContent
+alignItems
+alignSelf
+aspectRatio
+borderBottomWidth
+borderEndWidth
+borderLeftWidth
+borderRightWidth
+borderStartWidth
+borderTopWidth
+borderWidth
+bottom
+direction
+display
+end
+flex
+flexBasis
+flexDirection
+flexGrow
+flexShrink
+flexWrap
+height
+justifyContent
+left
+margin
+marginBottom
+marginEnd
+marginHorizontal
+marginLeft
+marginRight
+marginStart
+marginTop
+marginVertical
+maxHeight
+maxWidth
+minHeight
+minWidth
+overflow
+padding
+paddingBottom
+paddingEnd
+paddingHorizontal
+paddingLeft
+paddingRight
+paddingStart
+paddingTop
+paddingVertical
+position
+right
+start
+top
+width
+zIndexalignContent
-alignItems
-alignSelf
-aspectRatio
-borderBottomWidth
-borderEndWidth
-borderLeftWidth
-borderRightWidth
-borderStartWidth
-borderTopWidth
-borderWidth
-bottom
-direction
-display
-end
-flex
-flexBasis
-flexDirection
-flexGrow
-flexShrink
-flexWrap
-height
-justifyContent
-left
-margin
-marginBottom
-marginEnd
-marginHorizontal
-marginLeft
-marginRight
-marginStart
-marginTop
-marginVertical
-maxHeight
-maxWidth
-minHeight
-minWidth
-overflow
-padding
-paddingBottom
-paddingEnd
-paddingHorizontal
-paddingLeft
-paddingRight
-paddingStart
-paddingTop
-paddingVertical
-position
-right
-start
-top
-width
-zIndex
+alignContent
+alignItems
+alignSelf
+aspectRatio
+borderBottomWidth
+borderEndWidth
+borderLeftWidth
+borderRightWidth
+borderStartWidth
+borderTopWidth
+borderWidth
+bottom
+direction
+display
+end
+flex
+flexBasis
+flexDirection
+flexGrow
+flexShrink
+flexWrap
+height
+justifyContent
+left
+margin
+marginBottom
+marginEnd
+marginHorizontal
+marginLeft
+marginRight
+marginStart
+marginTop
+marginVertical
+maxHeight
+maxWidth
+minHeight
+minWidth
+overflow
+padding
+paddingBottom
+paddingEnd
+paddingHorizontal
+paddingLeft
+paddingRight
+paddingStart
+paddingTop
+paddingVertical
+position
+right
+start
+top
+width
+zIndexTypes
-Properties
-Presets
-easeInEaseOut
-linear
-spring
+Types
+Properties
+Presets
+easeInEaseOut
+linear
+springTypes
-Properties
-Presets
-easeInEaseOut
-linear
-spring
+Types
+Properties
+Presets
+easeInEaseOut
+linear
+springconstructor
-addEventListener
-removeEventListener
-openURL
-canOpenURL
-getInitialURL
+constructor
+addEventListener
+removeEventListener
+openURL
+canOpenURL
+getInitialURLconstructor
-addEventListener
-removeEventListener
-openURL
-canOpenURL
-getInitialURL
+constructor
+addEventListener
+removeEventListener
+openURL
+canOpenURL
+getInitialURLdataSource
-initialListSize
-onEndReachedThreshold
-pageSize
-renderRow
-renderScrollComponent
-scrollRenderAheadDistance
-stickyHeaderIndices
-enableEmptySections
-renderHeader
-onEndReached
-stickySectionHeadersEnabled
-renderSectionHeader
-renderSeparator
-onChangeVisibleRows
-removeClippedSubviews
-renderFooter
+dataSource
+initialListSize
+onEndReachedThreshold
+pageSize
+renderRow
+renderScrollComponent
+scrollRenderAheadDistance
+stickyHeaderIndices
+enableEmptySections
+renderHeader
+onEndReached
+stickySectionHeadersEnabled
+renderSectionHeader
+renderSeparator
+onChangeVisibleRows
+removeClippedSubviews
+renderFootergetMetrics
-scrollTo
-scrollToEnd
-flashScrollIndicators
+getMetrics
+scrollTo
+scrollToEnd
+flashScrollIndicatorsdataSource
-initialListSize
-onEndReachedThreshold
-pageSize
-renderRow
-renderScrollComponent
-scrollRenderAheadDistance
-stickyHeaderIndices
-enableEmptySections
-renderHeader
-onEndReached
-stickySectionHeadersEnabled
-renderSectionHeader
-renderSeparator
-onChangeVisibleRows
-removeClippedSubviews
-renderFooter
+dataSource
+initialListSize
+onEndReachedThreshold
+pageSize
+renderRow
+renderScrollComponent
+scrollRenderAheadDistance
+stickyHeaderIndices
+enableEmptySections
+renderHeader
+onEndReached
+stickySectionHeadersEnabled
+renderSectionHeader
+renderSeparator
+onChangeVisibleRows
+removeClippedSubviews
+renderFootergetMetrics
-scrollTo
-scrollToEnd
-flashScrollIndicators
+getMetrics
+scrollTo
+scrollToEnd
+flashScrollIndicatorsconstructor
-cloneWithRows
-cloneWithRowsAndSections
-getRowCount
-getRowAndSectionCount
-rowShouldUpdate
-getRowData
-getRowIDForFlatIndex
-getSectionIDForFlatIndex
-getSectionLengths
-sectionHeaderShouldUpdate
-getSectionHeaderData
+constructor
+cloneWithRows
+cloneWithRowsAndSections
+getRowCount
+getRowAndSectionCount
+rowShouldUpdate
+getRowData
+getRowIDForFlatIndex
+getSectionIDForFlatIndex
+getSectionLengths
+sectionHeaderShouldUpdate
+getSectionHeaderDataconstructor
-cloneWithRows
-cloneWithRowsAndSections
-getRowCount
-getRowAndSectionCount
-rowShouldUpdate
-getRowData
-getRowIDForFlatIndex
-getSectionIDForFlatIndex
-getSectionLengths
-sectionHeaderShouldUpdate
-getSectionHeaderData
+constructor
+cloneWithRows
+cloneWithRowsAndSections
+getRowCount
+getRowAndSectionCount
+rowShouldUpdate
+getRowData
+getRowIDForFlatIndex
+getSectionIDForFlatIndex
+getSectionLengths
+sectionHeaderShouldUpdate
+getSectionHeaderData- New issues should follow the Issue Template.
- Issues should provide clear, easy to follow steps alongside sample code to reproduce the issue. Ideally, provide a Snack. -
Is this issue a feature request?
Some features may not be a good fit for the core React Native library. This is usually the case for *new modules that Facebook does not use in production. In this case, a maintainer will explain that this should be released to npm as a separate module, allowing users to easily pull in the module in their projects.
@@ -101,7 +101,7 @@Hey @author, thanks for sending the pull request. Can you please add all the info specified in the template? This is necessary for people to be able to understand and review your pull request.
-Does the code style match the Style guide?
+Does the code style match the Style guide?
If not, link to the style guide and add the label 'Needs revision'.
Does the pull request add a completely new feature we don't want to add to the core and maintain?
Ask the author to release it a separate npm module and close the pull request.
diff --git a/docs/maintainers/index.html b/docs/maintainers/index.html
index 156504bd2c8..60583ad284a 100644
--- a/docs/maintainers/index.html
+++ b/docs/maintainers/index.html
@@ -1,4 +1,4 @@
-- New issues should follow the Issue Template.
- Issues should provide clear, easy to follow steps alongside sample code to reproduce the issue. Ideally, provide a Snack. -
Is this issue a feature request?
Some features may not be a good fit for the core React Native library. This is usually the case for *new modules that Facebook does not use in production. In this case, a maintainer will explain that this should be released to npm as a separate module, allowing users to easily pull in the module in their projects.
@@ -101,7 +101,7 @@Hey @author, thanks for sending the pull request. Can you please add all the info specified in the template? This is necessary for people to be able to understand and review your pull request.
-Does the code style match the Style guide?
+Does the code style match the Style guide?
If not, link to the style guide and add the label 'Needs revision'.
Does the pull request add a completely new feature we don't want to add to the core and maintain?
Ask the author to release it a separate npm module and close the pull request.
diff --git a/docs/maskedviewios.html b/docs/maskedviewios.html
index 1e0c16415fb..e4632214e48 100644
--- a/docs/maskedviewios.html
+++ b/docs/maskedviewios.html
@@ -72,10 +72,10 @@
visible
-supportedOrientations
-onRequestClose
-onShow
-transparent
-animationType
-hardwareAccelerated
-onDismiss
-onOrientationChange
-presentationStyle
-animated
+visible
+supportedOrientations
+onRequestClose
+onShow
+transparent
+animationType
+hardwareAccelerated
+onDismiss
+onOrientationChange
+presentationStyle
+animatedvisible
-supportedOrientations
-onRequestClose
-onShow
-transparent
-animationType
-hardwareAccelerated
-onDismiss
-onOrientationChange
-presentationStyle
-animated
+visible
+supportedOrientations
+onRequestClose
+onShow
+transparent
+animationType
+hardwareAccelerated
+onDismiss
+onOrientationChange
+presentationStyle
+animated- Fellow developers write and publish React Native modules to npm and open source them on GitHub.
- Making modules helps grow the React Native ecosystem and community. We recommend writing modules for your use cases and sharing them on npm. -
- Read the guides on Native Modules (iOS, Android) and Native UI Components (iOS, Android) if you are interested in extending native functionality. +
- Read the guides on Native Modules (iOS, Android) and Native UI Components (iOS, Android) if you are interested in extending native functionality.
- Looking for a pre-built component? Check JS.coach.
- Fellow developers write and publish React Native modules to npm and open source them on GitHub.
- Making modules helps grow the React Native ecosystem and community. We recommend writing modules for your use cases and sharing them on npm. -
- Read the guides on Native Modules (iOS, Android) and Native UI Components (iOS, Android) if you are interested in extending native functionality. +
- Read the guides on Native Modules (iOS, Android) and Native UI Components (iOS, Android) if you are interested in extending native functionality.
- Looking for a pre-built component? Check JS.coach.
- Each frame during this transition, the JavaScript thread needs to send a new x-offset to the main thread. If the JavaScript thread is locked up, it cannot do this and so no update occurs on that frame and the animation stutters.
AnimatedValue
Standard value for driving animations. One Animated.Value can drive multiple properties in a synchronized fashion, but can only be driven by one mechanism at a time. Using a new mechanism (e.g. starting a new animation, or calling setValue) will stop any previous ones.
Typically initialized with new Animated.Value(0);
See also Animated.
See also Animated.
Methods
-
-
Reference
diff --git a/docs/animatedvalue/index.html b/docs/animatedvalue/index.html index ddab537c6a3..7d20b2f55da 100644 --- a/docs/animatedvalue/index.html +++ b/docs/animatedvalue/index.html @@ -8,22 +8,22 @@ ga('send', 'pageview');AnimatedValue
Standard value for driving animations. One Animated.Value can drive multiple properties in a synchronized fashion, but can only be driven by one mechanism at a time. Using a new mechanism (e.g. starting a new animation, or calling setValue) will stop any previous ones.
Typically initialized with new Animated.Value(0);
See also Animated.
See also Animated.
Methods
-
-
Reference
diff --git a/docs/animatedvaluexy.html b/docs/animatedvaluexy.html index 6f50a2e61f1..f3f152fb57f 100644 --- a/docs/animatedvaluexy.html +++ b/docs/animatedvaluexy.html @@ -1,4 +1,4 @@ -AnimatedValueXY
2D Value for driving 2D animations, such as pan gestures. Almost identical API to normal Animated.Value, but multiplexed. Contains two regular Animated.Values under the hood.
See also Animated.
AnimatedValueXY
2D Value for driving 2D animations, such as pan gestures. Almost identical API to normal Animated.Value, but multiplexed. Contains two regular Animated.Values under the hood.
See also Animated.
Example
class DraggableView extends React.Component {
constructor(props) {
@@ -45,17 +45,17 @@
Methods
-
-
Reference
diff --git a/docs/animatedvaluexy/index.html b/docs/animatedvaluexy/index.html index 6f50a2e61f1..f3f152fb57f 100644 --- a/docs/animatedvaluexy/index.html +++ b/docs/animatedvaluexy/index.html @@ -1,4 +1,4 @@ -AnimatedValueXY
2D Value for driving 2D animations, such as pan gestures. Almost identical API to normal Animated.Value, but multiplexed. Contains two regular Animated.Values under the hood.
See also Animated.
AnimatedValueXY
2D Value for driving 2D animations, such as pan gestures. Almost identical API to normal Animated.Value, but multiplexed. Contains two regular Animated.Values under the hood.
See also Animated.
Example
class DraggableView extends React.Component {
constructor(props) {
@@ -45,17 +45,17 @@
Methods
-
-
Reference
diff --git a/docs/animations.html b/docs/animations.html index 8319d338215..2a36c6a950f 100644 --- a/docs/animations.html +++ b/docs/animations.html @@ -30,9 +30,9 @@ } });Animations
Animations are very important to create a great user experience. Stationary objects must overcome inertia as they start moving. Objects in motion have momentum and rarely come to a stop immediately. Animations allow you to convey physically believable motion in your interface.
-React Native provides two complementary animation systems: Animated for granular and interactive control of specific values, and LayoutAnimation for animated global layout transactions.
React Native provides two complementary animation systems: Animated for granular and interactive control of specific values, and LayoutAnimation for animated global layout transactions.
Animated API
-The Animated API is designed to make it very easy to concisely express a wide variety of interesting animation and interaction patterns in a very performant way. Animated focuses on declarative relationships between inputs and outputs, with configurable transforms in between, and simple start/stop methods to control time-based animation execution.
The Animated API is designed to make it very easy to concisely express a wide variety of interesting animation and interaction patterns in a very performant way. Animated focuses on declarative relationships between inputs and outputs, with configurable transforms in between, and simple start/stop methods to control time-based animation execution.
Animated exports four animatable component types: View, Text, Image, and ScrollView, but you can also create your own using Animated.createAnimatedComponent().
For example, a container view that fades in when it is mounted may look like this:
import React from 'react';
@@ -102,7 +102,7 @@ export default class App extends React.Component {
Because the entire configuration is declarative, we will be able to implement further optimizations that serialize the configuration and runs the animation on a high-priority thread.
Configuring animations
Animations are heavily configurable. Custom and predefined easing functions, delays, durations, decay factors, spring constants, and more can all be tweaked depending on the type of animation.
-Animated provides several animation types, the most commonly used one being Animated.timing(). It supports animating a value over time using one of various predefined easing functions, or you can use your own. Easing functions are typically used in animation to convey gradual acceleration and deceleration of objects.
+Animated provides several animation types, the most commonly used one being Animated.timing(). It supports animating a value over time using one of various predefined easing functions, or you can use your own. Easing functions are typically used in animation to convey gradual acceleration and deceleration of objects.
By default, timing will use a easeInOut curve that conveys gradual acceleration to full speed and concludes by gradually decelerating to a stop. You can specify a different easing function by passing a easing parameter. Custom duration or even a delay before the animation starts is also supported.
For example, if we want to create a 2-second long animation of an object that slightly backs up before moving to its final position:
Animated.timing(this.state.xPosition, {
@@ -111,7 +111,7 @@ Because the entire configuration is declarative, we will be able to implement fu
duration: 2000,
}).start();
-Take a look at the Configuring animations section of the Animated API reference to learn more about all the config parameters supported by the built-in animations.
+Take a look at the Configuring animations section of the Animated API reference to learn more about all the config parameters supported by the built-in animations.
Composing animations
Animations can be combined and played in sequence or in parallel. Sequential animations can play immediately after the previous animation has finished, or they can start after a specified delay. The Animated API provides several methods, such as sequence() and delay(), each of which simply take an array of animations to execute and automatically calls start()/stop() as needed.
For example, the following animation coasts to a stop, then it springs back while twirling in parallel:
@@ -135,9 +135,9 @@ Because the entire configuration is declarative, we will be able to implement fu
]).start(); // start the sequence group
If one animation is stopped or interrupted, then all other animations in the group are also stopped. Animated.parallel has a stopTogether option that can be set to false to disable this.
You can find a full list of composition methods in the Composing animations section of the Animated API reference.
You can find a full list of composition methods in the Composing animations section of the Animated API reference.
Combining animated values
-You can combine two animated values via addition, multiplication, division, or modulo to make a new animated value.
+You can combine two animated values via addition, multiplication, division, or modulo to make a new animated value.
There are some cases where an animated value needs to invert another animated value for calculation. An example is inverting a scale (2x --> 0.5x):
const a = new Animated.Value(1);
const b = Animated.divide(1, a);
@@ -165,7 +165,7 @@ Animated.spring(a, {
}],
}}
-interpolate() supports multiple range segments as well, which is handy for defining dead zones and other handy tricks. For example, to get an negation relationship at -300 that goes to 0 at -100, then back up to 1 at 0, and then back down to zero at 100 followed by a dead-zone that remains at 0 for everything beyond that, you could do:
interpolate() supports multiple range segments as well, which is handy for defining dead zones and other handy tricks. For example, to get an negation relationship at -300 that goes to 0 at -100, then back up to 1 at 0, and then back down to zero at 100 followed by a dead-zone that remains at 0 for everything beyond that, you could do:
value.interpolate({
inputRange: [-300, -100, 0, 100, 101],
outputRange: [300, 0, 1, 0, 0],
@@ -191,7 +191,7 @@ Animated.spring(a, {
outputRange: ['0deg', '360deg'],
});
-interpolate() also supports arbitrary easing functions, many of which are already implemented in the Easing module. interpolate() also has configurable behavior for extrapolating the outputRange. You can set the extrapolation by setting the extrapolate, extrapolateLeft, or extrapolateRight options. The default value is extend but you can use clamp to prevent the output value from exceeding outputRange.
interpolate() also supports arbitrary easing functions, many of which are already implemented in the Easing module. interpolate() also has configurable behavior for extrapolating the outputRange. You can set the extrapolation by setting the extrapolate, extrapolateLeft, or extrapolateRight options. The default value is extend but you can use clamp to prevent the output value from exceeding outputRange.
Tracking dynamic values
Animated values can also track other values. Just set the toValue of an animation to another animated value instead of a plain number. For example, a "Chat Heads" animation like the one used by Messenger on Android could be implemented with a spring() pinned on another animated value, or with timing() and a duration of 0 for rigid tracking. They can also be composed with interpolations:
Animated.spring(follower, {toValue: leader}).start();
@@ -204,7 +204,7 @@ Animated.timing(opacity, {
The leader and follower animated values would be implemented using Animated.ValueXY(). ValueXY is a handy way to deal with 2D interactions, such as panning or dragging. It is a simple wrapper that basically contains two Animated.Value instances and some helper functions that call through to them, making ValueXY a drop-in replacement for Value in many cases. It allows us to track both x and y values in the example above.
Tracking gestures
-Gestures, like panning or scrolling, and other events can map directly to animated values using Animated.event. This is done with a structured map syntax so that values can be extracted from complex event objects. The first level is an array to allow mapping across multiple args, and that array contains nested objects.
Gestures, like panning or scrolling, and other events can map directly to animated values using Animated.event. This is done with a structured map syntax so that values can be extracted from complex event objects. The first level is an array to allow mapping across multiple args, and that array contains nested objects.
For example, when working with horizontal scrolling gestures, you would do the following in order to map event.nativeEvent.contentOffset.x to scrollX (an Animated.Value):
onScroll={Animated.event(
// scrollX = e.nativeEvent.contentOffset.x
@@ -369,9 +369,9 @@ const styles = StyleSheet.create({
requestAnimationFrame
requestAnimationFrame is a polyfill from the browser that you might be familiar with. It accepts a function as its only argument and calls that function before the next repaint. It is an essential building block for animations that underlies all of the JavaScript-based animation APIs. In general, you shouldn't need to call this yourself - the animation APIs will manage frame updates for you.
setNativeProps
-As mentioned in the Direct Manipulation section, setNativeProps allows us to modify properties of native-backed components (components that are actually backed by native views, unlike composite components) directly, without having to setState and re-render the component hierarchy.
+As mentioned in the Direct Manipulation section, setNativeProps allows us to modify properties of native-backed components (components that are actually backed by native views, unlike composite components) directly, without having to setState and re-render the component hierarchy.
We could use this in the Rebound example to update the scale - this might be helpful if the component that we are updating is deeply nested and hasn't been optimized with shouldComponentUpdate.
-If you find your animations with dropping frames (performing below 60 frames per second), look into using setNativeProps or shouldComponentUpdate to optimize them. Or you could run the animations on the UI thread rather than the JavaScript thread with the useNativeDriver option. You may also want to defer any computationally intensive work until after animations are complete, using the InteractionManager. You can monitor the frame rate by using the In-App Developer Menu "FPS Monitor" tool.
+If you find your animations with dropping frames (performing below 60 frames per second), look into using setNativeProps or shouldComponentUpdate to optimize them. Or you could run the animations on the UI thread rather than the JavaScript thread with the useNativeDriver option. You may also want to defer any computationally intensive work until after animations are complete, using the InteractionManager. You can monitor the frame rate by using the In-App Developer Menu "FPS Monitor" tool.
Animations
Animations are very important to create a great user experience. Stationary objects must overcome inertia as they start moving. Objects in motion have momentum and rarely come to a stop immediately. Animations allow you to convey physically believable motion in your interface.
-React Native provides two complementary animation systems: Animated for granular and interactive control of specific values, and LayoutAnimation for animated global layout transactions.
React Native provides two complementary animation systems: Animated for granular and interactive control of specific values, and LayoutAnimation for animated global layout transactions.
Animated API
-The Animated API is designed to make it very easy to concisely express a wide variety of interesting animation and interaction patterns in a very performant way. Animated focuses on declarative relationships between inputs and outputs, with configurable transforms in between, and simple start/stop methods to control time-based animation execution.
The Animated API is designed to make it very easy to concisely express a wide variety of interesting animation and interaction patterns in a very performant way. Animated focuses on declarative relationships between inputs and outputs, with configurable transforms in between, and simple start/stop methods to control time-based animation execution.
Animated exports four animatable component types: View, Text, Image, and ScrollView, but you can also create your own using Animated.createAnimatedComponent().
For example, a container view that fades in when it is mounted may look like this:
import React from 'react';
@@ -102,7 +102,7 @@ export default class App extends React.Component {
Because the entire configuration is declarative, we will be able to implement further optimizations that serialize the configuration and runs the animation on a high-priority thread.
Configuring animations
Animations are heavily configurable. Custom and predefined easing functions, delays, durations, decay factors, spring constants, and more can all be tweaked depending on the type of animation.
-Animated provides several animation types, the most commonly used one being Animated.timing(). It supports animating a value over time using one of various predefined easing functions, or you can use your own. Easing functions are typically used in animation to convey gradual acceleration and deceleration of objects.
+Animated provides several animation types, the most commonly used one being Animated.timing(). It supports animating a value over time using one of various predefined easing functions, or you can use your own. Easing functions are typically used in animation to convey gradual acceleration and deceleration of objects.
By default, timing will use a easeInOut curve that conveys gradual acceleration to full speed and concludes by gradually decelerating to a stop. You can specify a different easing function by passing a easing parameter. Custom duration or even a delay before the animation starts is also supported.
For example, if we want to create a 2-second long animation of an object that slightly backs up before moving to its final position:
Animated.timing(this.state.xPosition, {
@@ -111,7 +111,7 @@ Because the entire configuration is declarative, we will be able to implement fu
duration: 2000,
}).start();
-Take a look at the Configuring animations section of the Animated API reference to learn more about all the config parameters supported by the built-in animations.
+Take a look at the Configuring animations section of the Animated API reference to learn more about all the config parameters supported by the built-in animations.
Composing animations
Animations can be combined and played in sequence or in parallel. Sequential animations can play immediately after the previous animation has finished, or they can start after a specified delay. The Animated API provides several methods, such as sequence() and delay(), each of which simply take an array of animations to execute and automatically calls start()/stop() as needed.
For example, the following animation coasts to a stop, then it springs back while twirling in parallel:
@@ -135,9 +135,9 @@ Because the entire configuration is declarative, we will be able to implement fu
]).start(); // start the sequence group
If one animation is stopped or interrupted, then all other animations in the group are also stopped. Animated.parallel has a stopTogether option that can be set to false to disable this.
You can find a full list of composition methods in the Composing animations section of the Animated API reference.
You can find a full list of composition methods in the Composing animations section of the Animated API reference.
Combining animated values
-You can combine two animated values via addition, multiplication, division, or modulo to make a new animated value.
+You can combine two animated values via addition, multiplication, division, or modulo to make a new animated value.
There are some cases where an animated value needs to invert another animated value for calculation. An example is inverting a scale (2x --> 0.5x):
const a = new Animated.Value(1);
const b = Animated.divide(1, a);
@@ -165,7 +165,7 @@ Animated.spring(a, {
}],
}}
-interpolate() supports multiple range segments as well, which is handy for defining dead zones and other handy tricks. For example, to get an negation relationship at -300 that goes to 0 at -100, then back up to 1 at 0, and then back down to zero at 100 followed by a dead-zone that remains at 0 for everything beyond that, you could do:
interpolate() supports multiple range segments as well, which is handy for defining dead zones and other handy tricks. For example, to get an negation relationship at -300 that goes to 0 at -100, then back up to 1 at 0, and then back down to zero at 100 followed by a dead-zone that remains at 0 for everything beyond that, you could do:
value.interpolate({
inputRange: [-300, -100, 0, 100, 101],
outputRange: [300, 0, 1, 0, 0],
@@ -191,7 +191,7 @@ Animated.spring(a, {
outputRange: ['0deg', '360deg'],
});
-interpolate() also supports arbitrary easing functions, many of which are already implemented in the Easing module. interpolate() also has configurable behavior for extrapolating the outputRange. You can set the extrapolation by setting the extrapolate, extrapolateLeft, or extrapolateRight options. The default value is extend but you can use clamp to prevent the output value from exceeding outputRange.
interpolate() also supports arbitrary easing functions, many of which are already implemented in the Easing module. interpolate() also has configurable behavior for extrapolating the outputRange. You can set the extrapolation by setting the extrapolate, extrapolateLeft, or extrapolateRight options. The default value is extend but you can use clamp to prevent the output value from exceeding outputRange.
Tracking dynamic values
Animated values can also track other values. Just set the toValue of an animation to another animated value instead of a plain number. For example, a "Chat Heads" animation like the one used by Messenger on Android could be implemented with a spring() pinned on another animated value, or with timing() and a duration of 0 for rigid tracking. They can also be composed with interpolations:
Animated.spring(follower, {toValue: leader}).start();
@@ -204,7 +204,7 @@ Animated.timing(opacity, {
The leader and follower animated values would be implemented using Animated.ValueXY(). ValueXY is a handy way to deal with 2D interactions, such as panning or dragging. It is a simple wrapper that basically contains two Animated.Value instances and some helper functions that call through to them, making ValueXY a drop-in replacement for Value in many cases. It allows us to track both x and y values in the example above.
Tracking gestures
-Gestures, like panning or scrolling, and other events can map directly to animated values using Animated.event. This is done with a structured map syntax so that values can be extracted from complex event objects. The first level is an array to allow mapping across multiple args, and that array contains nested objects.
Gestures, like panning or scrolling, and other events can map directly to animated values using Animated.event. This is done with a structured map syntax so that values can be extracted from complex event objects. The first level is an array to allow mapping across multiple args, and that array contains nested objects.
For example, when working with horizontal scrolling gestures, you would do the following in order to map event.nativeEvent.contentOffset.x to scrollX (an Animated.Value):
onScroll={Animated.event(
// scrollX = e.nativeEvent.contentOffset.x
@@ -369,9 +369,9 @@ const styles = StyleSheet.create({
requestAnimationFrame
requestAnimationFrame is a polyfill from the browser that you might be familiar with. It accepts a function as its only argument and calls that function before the next repaint. It is an essential building block for animations that underlies all of the JavaScript-based animation APIs. In general, you shouldn't need to call this yourself - the animation APIs will manage frame updates for you.
setNativeProps
-As mentioned in the Direct Manipulation section, setNativeProps allows us to modify properties of native-backed components (components that are actually backed by native views, unlike composite components) directly, without having to setState and re-render the component hierarchy.
+As mentioned in the Direct Manipulation section, setNativeProps allows us to modify properties of native-backed components (components that are actually backed by native views, unlike composite components) directly, without having to setState and re-render the component hierarchy.
We could use this in the Rebound example to update the scale - this might be helpful if the component that we are updating is deeply nested and hasn't been optimized with shouldComponentUpdate.
-If you find your animations with dropping frames (performing below 60 frames per second), look into using setNativeProps or shouldComponentUpdate to optimize them. Or you could run the animations on the UI thread rather than the JavaScript thread with the useNativeDriver option. You may also want to defer any computationally intensive work until after animations are complete, using the InteractionManager. You can monitor the frame rate by using the In-App Developer Menu "FPS Monitor" tool.
+If you find your animations with dropping frames (performing below 60 frames per second), look into using setNativeProps or shouldComponentUpdate to optimize them. Or you could run the animations on the UI thread rather than the JavaScript thread with the useNativeDriver option. You may also want to defer any computationally intensive work until after animations are complete, using the InteractionManager. You can monitor the frame rate by using the In-App Developer Menu "FPS Monitor" tool.
BackAndroid
Deprecated. Use BackHandler instead.
Methods
Reference
diff --git a/docs/backandroid/index.html b/docs/backandroid/index.html index c03c8d6f6d3..cf25e331e69 100644 --- a/docs/backandroid/index.html +++ b/docs/backandroid/index.html @@ -32,9 +32,9 @@BackAndroid
Deprecated. Use BackHandler instead.
Methods
Reference
diff --git a/docs/backhandler.html b/docs/backhandler.html index 50d366b2915..2a9aec9a6bb 100644 --- a/docs/backhandler.html +++ b/docs/backhandler.html @@ -74,9 +74,9 @@Methods
Reference
diff --git a/docs/backhandler/index.html b/docs/backhandler/index.html index 50d366b2915..2a9aec9a6bb 100644 --- a/docs/backhandler/index.html +++ b/docs/backhandler/index.html @@ -74,9 +74,9 @@Methods
Reference
diff --git a/docs/building-from-source.html b/docs/building-from-source.html index 3fbbba4ac59..5d117e9f9ea 100644 --- a/docs/building-from-source.html +++ b/docs/building-from-source.html @@ -131,7 +131,7 @@ ndk.dir=/Users/your_unix_name/android-ndk/anTroubleshooting
Gradle build fails in ndk-build. See the section about local.properties file above.
Testing your Changes
-If you made changes to React Native and submit a pull request, all tests will run on your pull request automatically. To run the tests locally, see Testing your Changes.
+If you made changes to React Native and submit a pull request, all tests will run on your pull request automatically. To run the tests locally, see Testing your Changes.
Button
A basic button component that should render nicely on any platform. Supports a minimal level of customization.

If this button doesn't look right for your app, you can build your own button using TouchableOpacity or TouchableNativeFeedback. For inspiration, look at the source code for this button component. Or, take a look at the wide variety of button components built by the community.
+If this button doesn't look right for your app, you can build your own button using TouchableOpacity or TouchableNativeFeedback. For inspiration, look at the source code for this button component. Or, take a look at the wide variety of button components built by the community.
Example usage:
import { Button } from 'react-native';
...
@@ -45,13 +45,13 @@
Props
-
-
Reference
@@ -96,7 +96,7 @@diff --git a/docs/button/index.html b/docs/button/index.html index c3d2921d7ac..5f9ed713f7c 100644 --- a/docs/button/index.html +++ b/docs/button/index.html @@ -31,7 +31,7 @@ });
Button
A basic button component that should render nicely on any platform. Supports a minimal level of customization.

If this button doesn't look right for your app, you can build your own button using TouchableOpacity or TouchableNativeFeedback. For inspiration, look at the source code for this button component. Or, take a look at the wide variety of button components built by the community.
+If this button doesn't look right for your app, you can build your own button using TouchableOpacity or TouchableNativeFeedback. For inspiration, look at the source code for this button component. Or, take a look at the wide variety of button components built by the community.
Example usage:
import { Button } from 'react-native';
...
@@ -45,13 +45,13 @@
Props
-
-
Reference
@@ -96,7 +96,7 @@diff --git a/docs/cameraroll.html b/docs/cameraroll.html index 2f611bdc0a6..09eed0ae6de 100644 --- a/docs/cameraroll.html +++ b/docs/cameraroll.html @@ -30,14 +30,14 @@ } });
CameraRoll
CameraRoll provides access to the local camera roll or photo library.
On iOS, the CameraRoll API requires the RCTCameraRoll library to be linked. You can refer to Linking Libraries (iOS) to learn more.
On iOS, the CameraRoll API requires the RCTCameraRoll library to be linked. You can refer to Linking Libraries (iOS) to learn more.
Permissions
The user's permission is required in order to access the Camera Roll on devices running iOS 10 or later. Add the NSPhotoLibraryUsageDescription key in your Info.plist with a string that describes how your app will use this data. This key will appear as Privacy - Photo Library Usage Description in Xcode.
If you are targeting devices running iOS 11 or later, you will also need to add the NSPhotoLibraryAddUsageDescription key in your Info.plist. Use this key to define a string that describes how your app will use this data. By adding this key to your Info.plist, you will be able to request write-only access permission from the user. If you try to save to the camera roll without this permission, your app will exit.
Methods
Reference
diff --git a/docs/cameraroll/index.html b/docs/cameraroll/index.html index 2f611bdc0a6..09eed0ae6de 100644 --- a/docs/cameraroll/index.html +++ b/docs/cameraroll/index.html @@ -30,14 +30,14 @@ } });CameraRoll
CameraRoll provides access to the local camera roll or photo library.
On iOS, the CameraRoll API requires the RCTCameraRoll library to be linked. You can refer to Linking Libraries (iOS) to learn more.
On iOS, the CameraRoll API requires the RCTCameraRoll library to be linked. You can refer to Linking Libraries (iOS) to learn more.
Permissions
The user's permission is required in order to access the Camera Roll on devices running iOS 10 or later. Add the NSPhotoLibraryUsageDescription key in your Info.plist with a string that describes how your app will use this data. This key will appear as Privacy - Photo Library Usage Description in Xcode.
If you are targeting devices running iOS 11 or later, you will also need to add the NSPhotoLibraryAddUsageDescription key in your Info.plist. Use this key to define a string that describes how your app will use this data. By adding this key to your Info.plist, you will be able to request write-only access permission from the user. If you try to save to the camera roll without this permission, your app will exit.
Methods
Reference
diff --git a/docs/checkbox.html b/docs/checkbox.html index fe79fe49a14..61d944ea063 100644 --- a/docs/checkbox.html +++ b/docs/checkbox.html @@ -11,14 +11,14 @@@keyword checkbox @keyword toggle
Props
Reference
diff --git a/docs/checkbox/index.html b/docs/checkbox/index.html index fe79fe49a14..61d944ea063 100644 --- a/docs/checkbox/index.html +++ b/docs/checkbox/index.html @@ -11,14 +11,14 @@@keyword checkbox @keyword toggle
Props
Reference
diff --git a/docs/clipboard.html b/docs/clipboard.html index 25bdd3b55c5..f9f97529da8 100644 --- a/docs/clipboard.html +++ b/docs/clipboard.html @@ -32,8 +32,8 @@Clipboard
Clipboard gives you an interface for setting and getting content from Clipboard on both iOS and Android
Methods
Reference
diff --git a/docs/clipboard/index.html b/docs/clipboard/index.html index 25bdd3b55c5..f9f97529da8 100644 --- a/docs/clipboard/index.html +++ b/docs/clipboard/index.html @@ -32,8 +32,8 @@Clipboard
Clipboard gives you an interface for setting and getting content from Clipboard on both iOS and Android
Methods
Reference
diff --git a/docs/colors.html b/docs/colors.html index 264350ef63c..61cd943a321 100644 --- a/docs/colors.html +++ b/docs/colors.html @@ -1,4 +1,4 @@ -Color Reference
Components in React Native are styled using JavaScript. Color properties usually match how CSS works on the web.
+Color Reference
Components in React Native are styled using JavaScript. Color properties usually match how CSS works on the web.
Red-green-blue
React Native supports rgb() and rgba() in both hexadecimal and functional notation:
-
diff --git a/docs/colors/index.html b/docs/colors/index.html
index 264350ef63c..61cd943a321 100644
--- a/docs/colors/index.html
+++ b/docs/colors/index.html
@@ -1,4 +1,4 @@
-
Color Reference
Components in React Native are styled using JavaScript. Color properties usually match how CSS works on the web.
+Color Reference
Components in React Native are styled using JavaScript. Color properties usually match how CSS works on the web.
Red-green-blue
React Native supports rgb() and rgba() in both hexadecimal and functional notation:
-
diff --git a/docs/communication-android.html b/docs/communication-android.html
index 945f518f2e2..04696f7944d 100644
--- a/docs/communication-android.html
+++ b/docs/communication-android.html
@@ -1,4 +1,4 @@
-
Communication between native and React Native
In Integrating with Existing Apps guide and Native UI Components guide we learn how to embed React Native in a native component and vice versa. When we mix native and React Native components, we'll eventually find a need to communicate between these two worlds. Some ways to achieve that have been already mentioned in other guides. This article summarizes available techniques.
+Communication between native and React Native
In Integrating with Existing Apps guide and Native UI Components guide we learn how to embed React Native in a native component and vice versa. When we mix native and React Native components, we'll eventually find a need to communicate between these two worlds. Some ways to achieve that have been already mentioned in other guides. This article summarizes available techniques.
Introduction
React Native is inspired by React, so the basic idea of the information flow is similar. The flow in React is one-directional. We maintain a hierarchy of components, in which each component depends only on its parent and its own internal state. We do this with properties: data is passed from a parent to its children in a top-down manner. If an ancestor component relies on the state of its descendant, one should pass down a callback to be used by the descendant to update the ancestor.
The same concept applies to React Native. As long as we are building our application purely within the framework, we can drive our app with properties and callbacks. But, when we mix React Native and native components, we need some special, cross-language mechanisms that would allow us to pass information between them.
@@ -72,15 +72,15 @@ mReactRootView.setAppProperties(updatedProps);Note: Currently, JS functions componentWillReceiveProps and componentWillUpdateProps of the top level RN component will not be called after a prop update. However, you can access the new props in componentWillMount function.
Passing properties from React Native to native
-The problem exposing properties of native components is covered in detail in this article. In short, properties that are to be reflected in JavaScript needs to be exposed as setter method annotated with @ReactProp, then just use them in React Native as if the component was an ordinary React Native component.
The problem exposing properties of native components is covered in detail in this article. In short, properties that are to be reflected in JavaScript needs to be exposed as setter method annotated with @ReactProp, then just use them in React Native as if the component was an ordinary React Native component.
Limits of properties
The main drawback of cross-language properties is that they do not support callbacks, which would allow us to handle bottom-up data bindings. Imagine you have a small RN view that you want to be removed from the native parent view as a result of a JS action. There is no way to do that with props, as the information would need to go bottom-up.
-Although we have a flavor of cross-language callbacks (described here), these callbacks are not always the thing we need. The main problem is that they are not intended to be passed as properties. Rather, this mechanism allows us to trigger a native action from JS, and handle the result of that action in JS.
+Although we have a flavor of cross-language callbacks (described here), these callbacks are not always the thing we need. The main problem is that they are not intended to be passed as properties. Rather, this mechanism allows us to trigger a native action from JS, and handle the result of that action in JS.
Other ways of cross-language interaction (events and native modules)
As stated in the previous chapter, using properties comes with some limitations. Sometimes properties are not enough to drive the logic of our app and we need a solution that gives more flexibility. This chapter covers other communication techniques available in React Native. They can be used for internal communication (between JS and native layers in RN) as well as for external communication (between RN and the 'pure native' part of your app).
React Native enables you to perform cross-language function calls. You can execute custom native code from JS and vice versa. Unfortunately, depending on the side we are working on, we achieve the same goal in different ways. For native - we use events mechanism to schedule an execution of a handler function in JS, while for React Native we directly call methods exported by native modules.
Calling React Native functions from native (events)
-Events are described in detail in this article. Note that using events gives us no guarantees about execution time, as the event is handled on a separate thread.
+Events are described in detail in this article. Note that using events gives us no guarantees about execution time, as the event is handled on a separate thread.
Events are powerful, because they allow us to change React Native components without needing a reference to them. However, there are some pitfalls that you can fall into while using them:
Calling native functions from React Native (native modules)
-Native modules are Java classes that are available in JS. Typically one instance of each module is created per JS bridge. They can export arbitrary functions and constants to React Native. They have been covered in detail in this article.
+Native modules are Java classes that are available in JS. Typically one instance of each module is created per JS bridge. They can export arbitrary functions and constants to React Native. They have been covered in detail in this article.
diff --git a/docs/communication-android/index.html b/docs/communication-android/index.html index 945f518f2e2..04696f7944d 100644 --- a/docs/communication-android/index.html +++ b/docs/communication-android/index.html @@ -1,4 +1,4 @@ -Warning: All native modules share the same namespace. Watch out for name collisions when creating new ones.
Communication between native and React Native
In Integrating with Existing Apps guide and Native UI Components guide we learn how to embed React Native in a native component and vice versa. When we mix native and React Native components, we'll eventually find a need to communicate between these two worlds. Some ways to achieve that have been already mentioned in other guides. This article summarizes available techniques.
+Communication between native and React Native
In Integrating with Existing Apps guide and Native UI Components guide we learn how to embed React Native in a native component and vice versa. When we mix native and React Native components, we'll eventually find a need to communicate between these two worlds. Some ways to achieve that have been already mentioned in other guides. This article summarizes available techniques.
Introduction
React Native is inspired by React, so the basic idea of the information flow is similar. The flow in React is one-directional. We maintain a hierarchy of components, in which each component depends only on its parent and its own internal state. We do this with properties: data is passed from a parent to its children in a top-down manner. If an ancestor component relies on the state of its descendant, one should pass down a callback to be used by the descendant to update the ancestor.
The same concept applies to React Native. As long as we are building our application purely within the framework, we can drive our app with properties and callbacks. But, when we mix React Native and native components, we need some special, cross-language mechanisms that would allow us to pass information between them.
@@ -72,15 +72,15 @@ mReactRootView.setAppProperties(updatedProps);Note: Currently, JS functions componentWillReceiveProps and componentWillUpdateProps of the top level RN component will not be called after a prop update. However, you can access the new props in componentWillMount function.
Passing properties from React Native to native
-The problem exposing properties of native components is covered in detail in this article. In short, properties that are to be reflected in JavaScript needs to be exposed as setter method annotated with @ReactProp, then just use them in React Native as if the component was an ordinary React Native component.
The problem exposing properties of native components is covered in detail in this article. In short, properties that are to be reflected in JavaScript needs to be exposed as setter method annotated with @ReactProp, then just use them in React Native as if the component was an ordinary React Native component.
Limits of properties
The main drawback of cross-language properties is that they do not support callbacks, which would allow us to handle bottom-up data bindings. Imagine you have a small RN view that you want to be removed from the native parent view as a result of a JS action. There is no way to do that with props, as the information would need to go bottom-up.
-Although we have a flavor of cross-language callbacks (described here), these callbacks are not always the thing we need. The main problem is that they are not intended to be passed as properties. Rather, this mechanism allows us to trigger a native action from JS, and handle the result of that action in JS.
+Although we have a flavor of cross-language callbacks (described here), these callbacks are not always the thing we need. The main problem is that they are not intended to be passed as properties. Rather, this mechanism allows us to trigger a native action from JS, and handle the result of that action in JS.
Other ways of cross-language interaction (events and native modules)
As stated in the previous chapter, using properties comes with some limitations. Sometimes properties are not enough to drive the logic of our app and we need a solution that gives more flexibility. This chapter covers other communication techniques available in React Native. They can be used for internal communication (between JS and native layers in RN) as well as for external communication (between RN and the 'pure native' part of your app).
React Native enables you to perform cross-language function calls. You can execute custom native code from JS and vice versa. Unfortunately, depending on the side we are working on, we achieve the same goal in different ways. For native - we use events mechanism to schedule an execution of a handler function in JS, while for React Native we directly call methods exported by native modules.
Calling React Native functions from native (events)
-Events are described in detail in this article. Note that using events gives us no guarantees about execution time, as the event is handled on a separate thread.
+Events are described in detail in this article. Note that using events gives us no guarantees about execution time, as the event is handled on a separate thread.
Events are powerful, because they allow us to change React Native components without needing a reference to them. However, there are some pitfalls that you can fall into while using them:
Calling native functions from React Native (native modules)
-Native modules are Java classes that are available in JS. Typically one instance of each module is created per JS bridge. They can export arbitrary functions and constants to React Native. They have been covered in detail in this article.
+Native modules are Java classes that are available in JS. Typically one instance of each module is created per JS bridge. They can export arbitrary functions and constants to React Native. They have been covered in detail in this article.
diff --git a/docs/communication-ios.html b/docs/communication-ios.html index 76edb7cf04d..399590b06aa 100644 --- a/docs/communication-ios.html +++ b/docs/communication-ios.html @@ -1,4 +1,4 @@ -Warning: All native modules share the same namespace. Watch out for name collisions when creating new ones.
Communication between native and React Native
In Integrating with Existing Apps guide and Native UI Components guide we learn how to embed React Native in a native component and vice versa. When we mix native and React Native components, we'll eventually find a need to communicate between these two worlds. Some ways to achieve that have been already mentioned in other guides. This article summarizes available techniques.
+Communication between native and React Native
In Integrating with Existing Apps guide and Native UI Components guide we learn how to embed React Native in a native component and vice versa. When we mix native and React Native components, we'll eventually find a need to communicate between these two worlds. Some ways to achieve that have been already mentioned in other guides. This article summarizes available techniques.
Introduction
React Native is inspired by React, so the basic idea of the information flow is similar. The flow in React is one-directional. We maintain a hierarchy of components, in which each component depends only on its parent and its own internal state. We do this with properties: data is passed from a parent to its children in a top-down manner. If an ancestor component relies on the state of its descendant, one should pass down a callback to be used by the descendant to update the ancestor.
The same concept applies to React Native. As long as we are building our application purely within the framework, we can drive our app with properties and callbacks. But, when we mix React Native and native components, we need some special, cross-language mechanisms that would allow us to pass information between them.
@@ -83,15 +83,15 @@ rootView.appProperties = @{Passing properties from React Native to native -The problem exposing properties of native components is covered in detail in this article. In short, export properties with RCT_CUSTOM_VIEW_PROPERTY macro in your custom native component, then just use them in React Native as if the component was an ordinary React Native component.
The problem exposing properties of native components is covered in detail in this article. In short, export properties with RCT_CUSTOM_VIEW_PROPERTY macro in your custom native component, then just use them in React Native as if the component was an ordinary React Native component.
Limits of properties
The main drawback of cross-language properties is that they do not support callbacks, which would allow us to handle bottom-up data bindings. Imagine you have a small RN view that you want to be removed from the native parent view as a result of a JS action. There is no way to do that with props, as the information would need to go bottom-up.
-Although we have a flavor of cross-language callbacks (described here), these callbacks are not always the thing we need. The main problem is that they are not intended to be passed as properties. Rather, this mechanism allows us to trigger a native action from JS, and handle the result of that action in JS.
+Although we have a flavor of cross-language callbacks (described here), these callbacks are not always the thing we need. The main problem is that they are not intended to be passed as properties. Rather, this mechanism allows us to trigger a native action from JS, and handle the result of that action in JS.
Other ways of cross-language interaction (events and native modules)
As stated in the previous chapter, using properties comes with some limitations. Sometimes properties are not enough to drive the logic of our app and we need a solution that gives more flexibility. This chapter covers other communication techniques available in React Native. They can be used for internal communication (between JS and native layers in RN) as well as for external communication (between RN and the 'pure native' part of your app).
React Native enables you to perform cross-language function calls. You can execute custom native code from JS and vice versa. Unfortunately, depending on the side we are working on, we achieve the same goal in different ways. For native - we use events mechanism to schedule an execution of a handler function in JS, while for React Native we directly call methods exported by native modules.
Calling React Native functions from native (events)
-Events are described in detail in this article. Note that using events gives us no guarantees about execution time, as the event is handled on a separate thread.
+Events are described in detail in this article. Note that using events gives us no guarantees about execution time, as the event is handled on a separate thread.
Events are powerful, because they allow us to change React Native components without needing a reference to them. However, there are some pitfalls that you can fall into while using them:
Native modules are Objective-C classes that are available in JS. Typically one instance of each module is created per JS bridge. They can export arbitrary functions and constants to React Native. They have been covered in detail in this article.
+Native modules are Objective-C classes that are available in JS. Typically one instance of each module is created per JS bridge. They can export arbitrary functions and constants to React Native. They have been covered in detail in this article.
The fact that native modules are singletons limits the mechanism in the context of embedding. Let's say we have a React Native component embedded in a native view and we want to update the native, parent view. Using the native module mechanism, we would export a function that not only takes expected arguments, but also an identifier of the parent native view. The identifier would be used to retrieve a reference to the parent view to update. That said, we would need to keep a mapping from identifiers to native views in the module.
Although this solution is complex, it is used in RCTUIManager, which is an internal React Native class that manages all React Native views.
Native modules can also be used to expose existing native libraries to JS. The Geolocation library is a living example of the idea.
@@ -110,7 +110,7 @@ rootView.appProperties = @{Layout computation flowWhen integrating native and React Native, we also need a way to consolidate two different layout systems. This section covers common layout problems and provides a brief description of mechanisms to address them.
Layout of a native component embedded in React Native
-This case is covered in this article. Basically, as all our native react views are subclasses of UIView, most style and size attributes will work like you would expect out of the box.
This case is covered in this article. Basically, as all our native react views are subclasses of UIView, most style and size attributes will work like you would expect out of the box.
Layout of a React Native component embedded in native
React Native content with fixed size
The simplest scenario is when we have a React Native app with a fixed size, which is known to the native side. In particular, a full-screen React Native view falls into this case. If we want a smaller root view, we can explicitly set RCTRootView's frame.
diff --git a/docs/communication-ios/index.html b/docs/communication-ios/index.html index 76edb7cf04d..399590b06aa 100644 --- a/docs/communication-ios/index.html +++ b/docs/communication-ios/index.html @@ -1,4 +1,4 @@ -Communication between native and React Native
In Integrating with Existing Apps guide and Native UI Components guide we learn how to embed React Native in a native component and vice versa. When we mix native and React Native components, we'll eventually find a need to communicate between these two worlds. Some ways to achieve that have been already mentioned in other guides. This article summarizes available techniques.
+Communication between native and React Native
In Integrating with Existing Apps guide and Native UI Components guide we learn how to embed React Native in a native component and vice versa. When we mix native and React Native components, we'll eventually find a need to communicate between these two worlds. Some ways to achieve that have been already mentioned in other guides. This article summarizes available techniques.
Introduction
React Native is inspired by React, so the basic idea of the information flow is similar. The flow in React is one-directional. We maintain a hierarchy of components, in which each component depends only on its parent and its own internal state. We do this with properties: data is passed from a parent to its children in a top-down manner. If an ancestor component relies on the state of its descendant, one should pass down a callback to be used by the descendant to update the ancestor.
The same concept applies to React Native. As long as we are building our application purely within the framework, we can drive our app with properties and callbacks. But, when we mix React Native and native components, we need some special, cross-language mechanisms that would allow us to pass information between them.
@@ -83,15 +83,15 @@ rootView.appProperties = @{Passing properties from React Native to native -The problem exposing properties of native components is covered in detail in this article. In short, export properties with RCT_CUSTOM_VIEW_PROPERTY macro in your custom native component, then just use them in React Native as if the component was an ordinary React Native component.
The problem exposing properties of native components is covered in detail in this article. In short, export properties with RCT_CUSTOM_VIEW_PROPERTY macro in your custom native component, then just use them in React Native as if the component was an ordinary React Native component.
Limits of properties
The main drawback of cross-language properties is that they do not support callbacks, which would allow us to handle bottom-up data bindings. Imagine you have a small RN view that you want to be removed from the native parent view as a result of a JS action. There is no way to do that with props, as the information would need to go bottom-up.
-Although we have a flavor of cross-language callbacks (described here), these callbacks are not always the thing we need. The main problem is that they are not intended to be passed as properties. Rather, this mechanism allows us to trigger a native action from JS, and handle the result of that action in JS.
+Although we have a flavor of cross-language callbacks (described here), these callbacks are not always the thing we need. The main problem is that they are not intended to be passed as properties. Rather, this mechanism allows us to trigger a native action from JS, and handle the result of that action in JS.
Other ways of cross-language interaction (events and native modules)
As stated in the previous chapter, using properties comes with some limitations. Sometimes properties are not enough to drive the logic of our app and we need a solution that gives more flexibility. This chapter covers other communication techniques available in React Native. They can be used for internal communication (between JS and native layers in RN) as well as for external communication (between RN and the 'pure native' part of your app).
React Native enables you to perform cross-language function calls. You can execute custom native code from JS and vice versa. Unfortunately, depending on the side we are working on, we achieve the same goal in different ways. For native - we use events mechanism to schedule an execution of a handler function in JS, while for React Native we directly call methods exported by native modules.
Calling React Native functions from native (events)
-Events are described in detail in this article. Note that using events gives us no guarantees about execution time, as the event is handled on a separate thread.
+Events are described in detail in this article. Note that using events gives us no guarantees about execution time, as the event is handled on a separate thread.
Events are powerful, because they allow us to change React Native components without needing a reference to them. However, there are some pitfalls that you can fall into while using them:
Native modules are Objective-C classes that are available in JS. Typically one instance of each module is created per JS bridge. They can export arbitrary functions and constants to React Native. They have been covered in detail in this article.
+Native modules are Objective-C classes that are available in JS. Typically one instance of each module is created per JS bridge. They can export arbitrary functions and constants to React Native. They have been covered in detail in this article.
The fact that native modules are singletons limits the mechanism in the context of embedding. Let's say we have a React Native component embedded in a native view and we want to update the native, parent view. Using the native module mechanism, we would export a function that not only takes expected arguments, but also an identifier of the parent native view. The identifier would be used to retrieve a reference to the parent view to update. That said, we would need to keep a mapping from identifiers to native views in the module.
Although this solution is complex, it is used in RCTUIManager, which is an internal React Native class that manages all React Native views.
Native modules can also be used to expose existing native libraries to JS. The Geolocation library is a living example of the idea.
@@ -110,7 +110,7 @@ rootView.appProperties = @{Layout computation flowWhen integrating native and React Native, we also need a way to consolidate two different layout systems. This section covers common layout problems and provides a brief description of mechanisms to address them.
Layout of a native component embedded in React Native
-This case is covered in this article. Basically, as all our native react views are subclasses of UIView, most style and size attributes will work like you would expect out of the box.
This case is covered in this article. Basically, as all our native react views are subclasses of UIView, most style and size attributes will work like you would expect out of the box.
Layout of a React Native component embedded in native
React Native content with fixed size
The simplest scenario is when we have a React Native app with a fixed size, which is known to the native side. In particular, a full-screen React Native view falls into this case. If we want a smaller root view, we can explicitly set RCTRootView's frame.
diff --git a/docs/components-and-apis.html b/docs/components-and-apis.html index 6c8092d0783..79ca359a249 100644 --- a/docs/components-and-apis.html +++ b/docs/components-and-apis.html @@ -31,12 +31,12 @@ });Components and APIs
React Native provides a number of built-in components. You will find a full list of components and APIs on the sidebar to the left. If you're not sure where to get started, take a look at the following categories:
-
-
You're not limited to the components and APIs bundled with React Native. React Native is a community of thousands of developers. If you're looking for a library that does something specific, search the npm registry for packages mentioning react-native, or check out Awesome React Native for a curated list.
Basic Components
diff --git a/docs/components-and-apis/index.html b/docs/components-and-apis/index.html index 6c8092d0783..79ca359a249 100644 --- a/docs/components-and-apis/index.html +++ b/docs/components-and-apis/index.html @@ -31,12 +31,12 @@ });Components and APIs
React Native provides a number of built-in components. You will find a full list of components and APIs on the sidebar to the left. If you're not sure where to get started, take a look at the following categories:
-
-
You're not limited to the components and APIs bundled with React Native. React Native is a community of thousands of developers. If you're looking for a library that does something specific, search the npm registry for packages mentioning react-native, or check out Awesome React Native for a curated list.
Basic Components
diff --git a/docs/custom-webview-android.html b/docs/custom-webview-android.html index e488944cd29..c83d43fcadb 100644 --- a/docs/custom-webview-android.html +++ b/docs/custom-webview-android.html @@ -44,7 +44,7 @@ } } -You'll need to follow the usual steps to register the module.
+You'll need to follow the usual steps to register the module.
Adding New Properties
To add a new property, you'll need to add it to CustomWebView, and then expose it in CustomWebViewManager.
public class CustomWebViewManager extends ReactWebViewManager {
diff --git a/docs/custom-webview-android/index.html b/docs/custom-webview-android/index.html
index e488944cd29..c83d43fcadb 100644
--- a/docs/custom-webview-android/index.html
+++ b/docs/custom-webview-android/index.html
@@ -44,7 +44,7 @@
}
}
-You'll need to follow the usual steps to register the module.
+You'll need to follow the usual steps to register the module.
Adding New Properties
To add a new property, you'll need to add it to CustomWebView, and then expose it in CustomWebViewManager.
public class CustomWebViewManager extends ReactWebViewManager {
diff --git a/docs/datepickerandroid.html b/docs/datepickerandroid.html
index 1831eed2522..d076fbf70f2 100644
--- a/docs/datepickerandroid.html
+++ b/docs/datepickerandroid.html
@@ -46,9 +46,9 @@
Methods
Reference
diff --git a/docs/datepickerandroid/index.html b/docs/datepickerandroid/index.html index 1831eed2522..d076fbf70f2 100644 --- a/docs/datepickerandroid/index.html +++ b/docs/datepickerandroid/index.html @@ -46,9 +46,9 @@Methods
Reference
diff --git a/docs/datepickerios.html b/docs/datepickerios.html index f77307e8733..dbe27571625 100644 --- a/docs/datepickerios.html +++ b/docs/datepickerios.html @@ -72,17 +72,17 @@ const styles = StyleSheet.create({
Props
-
-
Reference
@@ -135,7 +135,7 @@ const styles = StyleSheet.create({See maximumDate for an example image.
See maximumDate for an example image.
minuteInterval
The interval at which minutes can be selected.
diff --git a/docs/datepickerios/index.html b/docs/datepickerios/index.html index f77307e8733..dbe27571625 100644 --- a/docs/datepickerios/index.html +++ b/docs/datepickerios/index.html @@ -72,17 +72,17 @@ const styles = StyleSheet.create({
Props
-
-
Reference
@@ -135,7 +135,7 @@ const styles = StyleSheet.create({See maximumDate for an example image.
See maximumDate for an example image.
minuteInterval
The interval at which minutes can be selected.
diff --git a/docs/debugging.html b/docs/debugging.html index 51bae50fb75..f5b8c41404c 100644 --- a/docs/debugging.html +++ b/docs/debugging.html @@ -69,7 +69,7 @@ YellowBox.ignoreWarnings(['Warning: ...']);To debug the JavaScript code in Chrome, select "Debug JS Remotely" from the Developer Menu. This will open a new tab at http://localhost:8081/debugger-ui.
Select Tools → Developer Tools from the Chrome Menu to open the Developer Tools. You may also access the DevTools using keyboard shortcuts (⌘⌥I on macOS, Ctrl Shift I on Windows). You may also want to enable Pause On Caught Exceptions for a better debugging experience.
-Note: the React Developer Tools Chrome extension does not work with React Native, but you can use its standalone version instead. Read this section to learn how.
+Note: the React Developer Tools Chrome extension does not work with React Native, but you can use its standalone version instead. Read this section to learn how.
Debugging using a custom JavaScript debugger
To use a custom JavaScript debugger in place of Chrome Developer Tools, set the REACT_DEBUGGER environment variable to a command that will start your custom debugger. You can then select "Debug JS Remotely" from the Developer Menu to start debugging.
To debug the JavaScript code in Chrome, select "Debug JS Remotely" from the Developer Menu. This will open a new tab at http://localhost:8081/debugger-ui.
Select Tools → Developer Tools from the Chrome Menu to open the Developer Tools. You may also access the DevTools using keyboard shortcuts (⌘⌥I on macOS, Ctrl Shift I on Windows). You may also want to enable Pause On Caught Exceptions for a better debugging experience.
-Note: the React Developer Tools Chrome extension does not work with React Native, but you can use its standalone version instead. Read this section to learn how.
+Note: the React Developer Tools Chrome extension does not work with React Native, but you can use its standalone version instead. Read this section to learn how.
Debugging using a custom JavaScript debugger
To use a custom JavaScript debugger in place of Chrome Developer Tools, set the REACT_DEBUGGER environment variable to a command that will start your custom debugger. You can then select "Debug JS Remotely" from the Developer Menu to start debugging.
Dimensions
Methods
Reference
diff --git a/docs/dimensions/index.html b/docs/dimensions/index.html index 12a043ab0cb..50557c04b2d 100644 --- a/docs/dimensions/index.html +++ b/docs/dimensions/index.html @@ -31,10 +31,10 @@ });Dimensions
You can now use MyButton inside of TouchableOpacity! A sidenote for clarity: we used the ref callback syntax here, rather than the traditional string-based ref.
You may have noticed that we passed all of the props down to the child view using {...this.props}. The reason for this is that TouchableOpacity is actually a composite component, and so in addition to depending on setNativeProps on its child, it also requires that the child perform touch handling. To do this, it passes on various props that call back to the TouchableOpacity component. TouchableHighlight, in contrast, is backed by a native view and only requires that we implement setNativeProps.
You may have noticed that we passed all of the props down to the child view using {...this.props}. The reason for this is that TouchableOpacity is actually a composite component, and so in addition to depending on setNativeProps on its child, it also requires that the child perform touch handling. To do this, it passes on various props that call back to the TouchableOpacity component. TouchableHighlight, in contrast, is backed by a native view and only requires that we implement setNativeProps.
setNativeProps to clear TextInput value
Another very common use case of setNativeProps is to clear the value of a TextInput. The controlled prop of TextInput can sometimes drop characters when the bufferDelay is low and the user types very quickly. Some developers prefer to skip this prop entirely and instead use setNativeProps to directly manipulate the TextInput value when necessary. For example, the following code demonstrates clearing the input when you tap a button:
import React from 'react';
@@ -209,7 +209,7 @@ render() {
Note that these measurements are not available until after the rendering has been completed in native. If you need the measurements as soon as possible, consider using the onLayout prop instead.
+Note that these measurements are not available until after the rendering has been completed in native. If you need the measurements as soon as possible, consider using the onLayout prop instead.
measureInWindow(callback)
Determines the location of the given view in the window and returns the values via an async callback. If the React root view is embedded in another native view, this will give you the absolute coordinates. If successful, the callback will be called with the following arguments:
diff --git a/docs/direct-manipulation/index.html b/docs/direct-manipulation/index.html
index 59ecc0cc6ea..db50b2dc263 100644
--- a/docs/direct-manipulation/index.html
+++ b/docs/direct-manipulation/index.html
@@ -153,7 +153,7 @@ render() {
width: 880px;
"
>
You can now use MyButton inside of TouchableOpacity! A sidenote for clarity: we used the ref callback syntax here, rather than the traditional string-based ref.
You may have noticed that we passed all of the props down to the child view using {...this.props}. The reason for this is that TouchableOpacity is actually a composite component, and so in addition to depending on setNativeProps on its child, it also requires that the child perform touch handling. To do this, it passes on various props that call back to the TouchableOpacity component. TouchableHighlight, in contrast, is backed by a native view and only requires that we implement setNativeProps.
You may have noticed that we passed all of the props down to the child view using {...this.props}. The reason for this is that TouchableOpacity is actually a composite component, and so in addition to depending on setNativeProps on its child, it also requires that the child perform touch handling. To do this, it passes on various props that call back to the TouchableOpacity component. TouchableHighlight, in contrast, is backed by a native view and only requires that we implement setNativeProps.
setNativeProps to clear TextInput value
Another very common use case of setNativeProps is to clear the value of a TextInput. The controlled prop of TextInput can sometimes drop characters when the bufferDelay is low and the user types very quickly. Some developers prefer to skip this prop entirely and instead use setNativeProps to directly manipulate the TextInput value when necessary. For example, the following code demonstrates clearing the input when you tap a button:
import React from 'react';
@@ -209,7 +209,7 @@ render() {
Note that these measurements are not available until after the rendering has been completed in native. If you need the measurements as soon as possible, consider using the onLayout prop instead.
+Note that these measurements are not available until after the rendering has been completed in native. If you need the measurements as soon as possible, consider using the onLayout prop instead.
measureInWindow(callback)
Determines the location of the given view in the window and returns the values via an async callback. If the React root view is embedded in another native view, this will give you the absolute coordinates. If successful, the callback will be called with the following arguments:
diff --git a/docs/drawerlayoutandroid.html b/docs/drawerlayoutandroid.html
index fecf6e75c09..24b78171bf3 100644
--- a/docs/drawerlayoutandroid.html
+++ b/docs/drawerlayoutandroid.html
@@ -52,25 +52,25 @@
Props
-
-
Methods
Reference
@@ -200,7 +200,7 @@@@ -211,7 +211,7 @@
Methods
diff --git a/docs/drawerlayoutandroid/index.html b/docs/drawerlayoutandroid/index.html index fecf6e75c09..24b78171bf3 100644 --- a/docs/drawerlayoutandroid/index.html +++ b/docs/drawerlayoutandroid/index.html @@ -52,25 +52,25 @@Props
-
-
Methods
Reference
@@ -200,7 +200,7 @@@@ -211,7 +211,7 @@
Methods
diff --git a/docs/easing.html b/docs/easing.html index 48be046c1bc..4d86815282d 100644 --- a/docs/easing.html +++ b/docs/easing.html @@ -1,4 +1,4 @@ -Easing
The Easing module implements common easing functions. This module is used by Animated.timing() to convey physically believable motion in animations.
Easing
The Easing module implements common easing functions. This module is used by Animated.timing() to convey physically believable motion in animations.
You can find a visualization of some common easing functions at http://easings.net/
Predefined animations
The Easing module provides several predefined animations through the following methods:
-
-
Standard functions
Three standard easing functions are provided:
-The poly function can be used to implement quartic, quintic, and other higher power functions.
The poly function can be used to implement quartic, quintic, and other higher power functions.
Additional functions
Additional mathematical functions are provided by the following methods:
-
-
The following helpers are used to modify other easing functions.
-
-
Methods
-
-
Reference
diff --git a/docs/easing/index.html b/docs/easing/index.html index 48be046c1bc..4d86815282d 100644 --- a/docs/easing/index.html +++ b/docs/easing/index.html @@ -1,4 +1,4 @@ -Easing
The Easing module implements common easing functions. This module is used by Animated.timing() to convey physically believable motion in animations.
Easing
The Easing module implements common easing functions. This module is used by Animated.timing() to convey physically believable motion in animations.
You can find a visualization of some common easing functions at http://easings.net/
Predefined animations
The Easing module provides several predefined animations through the following methods:
-
-
Standard functions
Three standard easing functions are provided:
-The poly function can be used to implement quartic, quintic, and other higher power functions.
The poly function can be used to implement quartic, quintic, and other higher power functions.
Additional functions
Additional mathematical functions are provided by the following methods:
-
-
The following helpers are used to modify other easing functions.
-
-
Methods
-
-
Reference
diff --git a/docs/flatlist.html b/docs/flatlist.html index 5ab9f4c5e12..b4b2300c383 100644 --- a/docs/flatlist.html +++ b/docs/flatlist.html @@ -41,7 +41,7 @@If you need section support, use <SectionList>.
If you need section support, use <SectionList>.
Minimal Example:
<FlatList
data={[{key: 'a'}, {key: 'b'}]}
@@ -109,52 +109,52 @@ class MultiSelectList extends React.PureComponent {
}
}
-This is a convenience wrapper around <VirtualizedList>, and thus inherits its props (as well as those of <ScrollView>) that aren't explicitly listed here, along with the following caveats:
This is a convenience wrapper around <VirtualizedList>, and thus inherits its props (as well as those of <ScrollView>) that aren't explicitly listed here, along with the following caveats:
Also inherits ScrollView Props, unless it is nested in another FlatList of same orientation.
+Also inherits ScrollView Props, unless it is nested in another FlatList of same orientation.
Props
-
-
Methods
-
-
Reference
@@ -192,7 +192,7 @@ class MultiSelectList extends React.PureComponent {data
-For simplicity, data is just a plain array. If you want to use something else, like an immutable list, use the underlying VirtualizedList directly.
For simplicity, data is just a plain array. If you want to use something else, like an immutable list, use the underlying VirtualizedList directly.
| Type | Required |
|---|
| Type | Required |
|---|---|
| Type | Required |
| color | No |
| color | No |
@@ -125,7 +125,7 @@
@@ -176,7 +176,7 @@
diff --git a/docs/image-style-props/index.html b/docs/image-style-props/index.html index f085502b4c9..997a0e91ca0 100644 --- a/docs/image-style-props/index.html +++ b/docs/image-style-props/index.html @@ -31,20 +31,20 @@ });
Image Style Props
Props
-
-
Reference
@@ -95,7 +95,7 @@@@ -125,7 +125,7 @@
@@ -176,7 +176,7 @@
diff --git a/docs/image.html b/docs/image.html index 37b49c64d11..c7c3a8de19f 100644 --- a/docs/image.html +++ b/docs/image.html @@ -112,33 +112,33 @@ AppRegistry.registerComponent(
Props
-
-
Methods
-
-
Reference
@@ -154,22 +154,22 @@ AppRegistry.registerComponent(-
-
ImageEditor
Methods
Reference
diff --git a/docs/imageeditor/index.html b/docs/imageeditor/index.html index 4a4d4219276..1dc71922dbd 100644 --- a/docs/imageeditor/index.html +++ b/docs/imageeditor/index.html @@ -31,7 +31,7 @@ });ImageEditor
Methods
Reference
diff --git a/docs/imagepickerios.html b/docs/imagepickerios.html index 0aafcb58f7d..d4e6a7aaa18 100644 --- a/docs/imagepickerios.html +++ b/docs/imagepickerios.html @@ -31,10 +31,10 @@ });ImagePickerIOS
Methods
-
-
Reference
diff --git a/docs/imagepickerios/index.html b/docs/imagepickerios/index.html index 0aafcb58f7d..d4e6a7aaa18 100644 --- a/docs/imagepickerios/index.html +++ b/docs/imagepickerios/index.html @@ -31,10 +31,10 @@ });ImagePickerIOS
Methods
-
-
Reference
diff --git a/docs/images.html b/docs/images.html index 1bdbdf758e6..f20fc6da7e8 100644 --- a/docs/images.html +++ b/docs/images.html @@ -85,7 +85,7 @@ var icon = this.props.activeThese approaches provide no safety checks. It's up to you to guarantee that those images are available in the application. Also you have to specify image dimensions manually.
Network Images
-Many of the images you will display in your app will not be available at compile time, or you will want to load some dynamically to keep the binary size down. Unlike with static resources, you will need to manually specify the dimensions of your image. It's highly recommended that you use https as well in order to satisfy App Transport Security requirements on iOS.
+Many of the images you will display in your app will not be available at compile time, or you will want to load some dynamically to keep the binary size down. Unlike with static resources, you will need to manually specify the dimensions of your image. It's highly recommended that you use https as well in order to satisfy App Transport Security requirements on iOS.
// GOOD
<Image source={{uri: 'https://facebook.github.io/react/logo-og.png'}}
style={{width: 400, height: 400}} />
@@ -142,7 +142,7 @@ var icon = this.props.active
/>
Local Filesystem Images
-See CameraRoll for an example of using local resources that are outside of Images.xcassets.
See CameraRoll for an example of using local resources that are outside of Images.xcassets.
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.
Why Not Automatically Size Everything?
diff --git a/docs/images/index.html b/docs/images/index.html index 1bdbdf758e6..f20fc6da7e8 100644 --- a/docs/images/index.html +++ b/docs/images/index.html @@ -85,7 +85,7 @@ var icon = this.props.activeThese approaches provide no safety checks. It's up to you to guarantee that those images are available in the application. Also you have to specify image dimensions manually.
Network Images
-Many of the images you will display in your app will not be available at compile time, or you will want to load some dynamically to keep the binary size down. Unlike with static resources, you will need to manually specify the dimensions of your image. It's highly recommended that you use https as well in order to satisfy App Transport Security requirements on iOS.
+Many of the images you will display in your app will not be available at compile time, or you will want to load some dynamically to keep the binary size down. Unlike with static resources, you will need to manually specify the dimensions of your image. It's highly recommended that you use https as well in order to satisfy App Transport Security requirements on iOS.
// GOOD
<Image source={{uri: 'https://facebook.github.io/react/logo-og.png'}}
style={{width: 400, height: 400}} />
@@ -142,7 +142,7 @@ var icon = this.props.active
/>
Local Filesystem Images
-See CameraRoll for an example of using local resources that are outside of Images.xcassets.
See CameraRoll for an example of using local resources that are outside of Images.xcassets.
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.
Why Not Automatically Size Everything?
diff --git a/docs/imagestore.html b/docs/imagestore.html index ecc601524bd..5043d63250f 100644 --- a/docs/imagestore.html +++ b/docs/imagestore.html @@ -31,10 +31,10 @@ });ImageStore
Methods
-
-
Reference
diff --git a/docs/imagestore/index.html b/docs/imagestore/index.html index ecc601524bd..5043d63250f 100644 --- a/docs/imagestore/index.html +++ b/docs/imagestore/index.html @@ -31,10 +31,10 @@ });ImageStore
Methods
-
-
Reference
diff --git a/docs/improvingux.html b/docs/improvingux.html index 2db9df1094b..1b883feb648 100644 --- a/docs/improvingux.html +++ b/docs/improvingux.html @@ -38,19 +38,19 @@Check out TextInput docs for more configuration options.
Check out TextInput docs for more configuration options.
Manage layout when keyboard is visible
-Software keyboard takes almost half of the screen. If you have interactive elements that can get covered by the keyboard, make sure they are still accessible by using the KeyboardAvoidingView component.
Software keyboard takes almost half of the screen. If you have interactive elements that can get covered by the keyboard, make sure they are still accessible by using the KeyboardAvoidingView component.
Make tappable areas larger
-On mobile phones it's hard to be very precise when pressing buttons. Make sure all interactive elements are 44x44 or larger. One way to do this is to leave enough space for the element, padding, minWidth and minHeight style values can be useful for that. Alternatively, you can use hitSlop prop to increase interactive area without affecting the layout. Here's a demo:
On mobile phones it's hard to be very precise when pressing buttons. Make sure all interactive elements are 44x44 or larger. One way to do this is to leave enough space for the element, padding, minWidth and minHeight style values can be useful for that. Alternatively, you can use hitSlop prop to increase interactive area without affecting the layout. Here's a demo:
Use Android Ripple
-Android API 21+ uses the material design ripple to provide user with feedback when they touch an interactable area on the screen. React Native exposes this through the TouchableNativeFeedback component. Using this touchable effect instead of opacity or highlight will often make your app feel much more fitting on the platform. That said, you need to be careful when using it because it doesn't work on iOS or on Android API < 21, so you will need to fallback to using one of the other Touchable components on iOS. You can use a library like react-native-platform-touchable to handle the platform differences for you.
Android API 21+ uses the material design ripple to provide user with feedback when they touch an interactable area on the screen. React Native exposes this through the TouchableNativeFeedback component. Using this touchable effect instead of opacity or highlight will often make your app feel much more fitting on the platform. That said, you need to be careful when using it because it doesn't work on iOS or on Android API < 21, so you will need to fallback to using one of the other Touchable components on iOS. You can use a library like react-native-platform-touchable to handle the platform differences for you.
Screen orientation lock
diff --git a/docs/improvingux/index.html b/docs/improvingux/index.html index 2db9df1094b..1b883feb648 100644 --- a/docs/improvingux/index.html +++ b/docs/improvingux/index.html @@ -38,19 +38,19 @@Check out TextInput docs for more configuration options.
Check out TextInput docs for more configuration options.
Manage layout when keyboard is visible
-Software keyboard takes almost half of the screen. If you have interactive elements that can get covered by the keyboard, make sure they are still accessible by using the KeyboardAvoidingView component.
Software keyboard takes almost half of the screen. If you have interactive elements that can get covered by the keyboard, make sure they are still accessible by using the KeyboardAvoidingView component.
Make tappable areas larger
-On mobile phones it's hard to be very precise when pressing buttons. Make sure all interactive elements are 44x44 or larger. One way to do this is to leave enough space for the element, padding, minWidth and minHeight style values can be useful for that. Alternatively, you can use hitSlop prop to increase interactive area without affecting the layout. Here's a demo:
On mobile phones it's hard to be very precise when pressing buttons. Make sure all interactive elements are 44x44 or larger. One way to do this is to leave enough space for the element, padding, minWidth and minHeight style values can be useful for that. Alternatively, you can use hitSlop prop to increase interactive area without affecting the layout. Here's a demo:
Use Android Ripple
-Android API 21+ uses the material design ripple to provide user with feedback when they touch an interactable area on the screen. React Native exposes this through the TouchableNativeFeedback component. Using this touchable effect instead of opacity or highlight will often make your app feel much more fitting on the platform. That said, you need to be careful when using it because it doesn't work on iOS or on Android API < 21, so you will need to fallback to using one of the other Touchable components on iOS. You can use a library like react-native-platform-touchable to handle the platform differences for you.
Android API 21+ uses the material design ripple to provide user with feedback when they touch an interactable area on the screen. React Native exposes this through the TouchableNativeFeedback component. Using this touchable effect instead of opacity or highlight will often make your app feel much more fitting on the platform. That said, you need to be careful when using it because it doesn't work on iOS or on Android API < 21, so you will need to fallback to using one of the other Touchable components on iOS. You can use a library like react-native-platform-touchable to handle the platform differences for you.
Screen orientation lock
diff --git a/docs/inputaccessoryview.html b/docs/inputaccessoryview.html index 9beed72d1a1..d7d320903a9 100644 --- a/docs/inputaccessoryview.html +++ b/docs/inputaccessoryview.html @@ -73,9 +73,9 @@ AppRegistry.registerComponent('AwesomeProject', () => UselessTextInput);This component can also be used to create sticky text inputs (text inputs which are anchored to the top of the keyboard). To do this, wrap a TextInput with the InputAccessoryView component, and don't set a nativeID. For an example, look at InputAccessoryViewExample.js.
Props
Reference
@@ -86,7 +86,7 @@ AppRegistry.registerComponent('AwesomeProject', () => UselessTextInput);@@ -107,7 +107,7 @@ AppRegistry.registerComponent('AwesomeProject', () => UselessTextInput);
Layout Props
Props
-
-
Reference
diff --git a/docs/layout-props/index.html b/docs/layout-props/index.html index a08051033b4..e3b28538a91 100644 --- a/docs/layout-props/index.html +++ b/docs/layout-props/index.html @@ -31,59 +31,59 @@ });Layout Props
Props
-
-
Reference
diff --git a/docs/layoutanimation.html b/docs/layoutanimation.html index a4119b4efe4..37cde083a8d 100644 --- a/docs/layoutanimation.html +++ b/docs/layoutanimation.html @@ -36,18 +36,18 @@Methods
Properties
-
-
Reference
diff --git a/docs/layoutanimation/index.html b/docs/layoutanimation/index.html index a4119b4efe4..37cde083a8d 100644 --- a/docs/layoutanimation/index.html +++ b/docs/layoutanimation/index.html @@ -36,18 +36,18 @@Methods
Properties
-
-
Reference
diff --git a/docs/linking.html b/docs/linking.html index fc0fbe5b965..96c02d0f844 100644 --- a/docs/linking.html +++ b/docs/linking.html @@ -59,7 +59,7 @@ android:name=".MainActivity" android:launchMode="singleTask"> -NOTE: On iOS, you'll need to link RCTLinking to your project by following the steps described here. If you also want to listen to incoming app links during your app's execution, you'll need to add the following lines to your *AppDelegate.m:
NOTE: On iOS, you'll need to link RCTLinking to your project by following the steps described here. If you also want to listen to incoming app links during your app's execution, you'll need to add the following lines to your *AppDelegate.m:
// iOS 9.x or newer
#import <React/RCTLinkingManager.h>
@@ -116,12 +116,12 @@
Methods
-
-
Reference
diff --git a/docs/linking/index.html b/docs/linking/index.html index fc0fbe5b965..96c02d0f844 100644 --- a/docs/linking/index.html +++ b/docs/linking/index.html @@ -59,7 +59,7 @@ android:name=".MainActivity" android:launchMode="singleTask"> -NOTE: On iOS, you'll need to link RCTLinking to your project by following the steps described here. If you also want to listen to incoming app links during your app's execution, you'll need to add the following lines to your *AppDelegate.m:
NOTE: On iOS, you'll need to link RCTLinking to your project by following the steps described here. If you also want to listen to incoming app links during your app's execution, you'll need to add the following lines to your *AppDelegate.m:
// iOS 9.x or newer
#import <React/RCTLinkingManager.h>
@@ -116,12 +116,12 @@
Methods
-
-
Reference
diff --git a/docs/listview.html b/docs/listview.html index eb3e9d78278..997c430a61c 100644 --- a/docs/listview.html +++ b/docs/listview.html @@ -1,4 +1,4 @@ -ListView
DEPRECATED - use one of the new list components, such as FlatList or SectionList for bounded memory use, fewer bugs, better performance, an easier to use API, and more features. Check out this blog post for more details.
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.
ListView
DEPRECATED - use one of the new list components, such as FlatList or SectionList for bounded memory use, fewer bugs, better performance, an easier to use API, and more features. Check out this blog post for more details.
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:
class MyComponent extends Component {
constructor() {
@@ -59,39 +59,39 @@
Props
-
Methods
-
Reference
Props
dataSource
-An instance of ListView.DataSource to use
+An instance of ListView.DataSource to use
Type Required
diff --git a/docs/listview/index.html b/docs/listview/index.html
index eb3e9d78278..997c430a61c 100644
--- a/docs/listview/index.html
+++ b/docs/listview/index.html
@@ -1,4 +1,4 @@
-ListView · React Native EditListView
DEPRECATED - use one of the new list components, such as FlatList or SectionList for bounded memory use, fewer bugs, better performance, an easier to use API, and more features. Check out this blog post for more details.
-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.
+ EditListView
DEPRECATED - use one of the new list components, such as FlatList or SectionList for bounded memory use, fewer bugs, better performance, an easier to use API, and more features. Check out this blog post for more details.
+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:
class MyComponent extends Component {
constructor() {
@@ -59,39 +59,39 @@
Props
-
Methods
-
Reference
Props
dataSource
-An instance of ListView.DataSource to use
+An instance of ListView.DataSource to use
Type Required
diff --git a/docs/listviewdatasource.html b/docs/listviewdatasource.html
index da8698563ce..14666bd6ee5 100644
--- a/docs/listviewdatasource.html
+++ b/docs/listviewdatasource.html
@@ -45,18 +45,18 @@ _onDataArrived(newData) {
Methods
-
Reference
diff --git a/docs/listviewdatasource/index.html b/docs/listviewdatasource/index.html
index da8698563ce..14666bd6ee5 100644
--- a/docs/listviewdatasource/index.html
+++ b/docs/listviewdatasource/index.html
@@ -45,18 +45,18 @@ _onDataArrived(newData) {
Methods
-
Reference
diff --git a/docs/maintainers.html b/docs/maintainers.html
index 156504bd2c8..60583ad284a 100644
--- a/docs/maintainers.html
+++ b/docs/maintainers.html
@@ -1,4 +1,4 @@
-What to Expect from Maintainers · React Native EditWhat to Expect from Maintainers
So you have read through the contributor's guide and you're getting ready to send your first pull request. Perhaps you've found an issue in React Native and want to work with the maintainers to land a fix. Here's what you can expect to happen when you open an issue or send a pull request.
+ EditWhat to Expect from Maintainers
So you have read through the contributor's guide and you're getting ready to send your first pull request. Perhaps you've found an issue in React Native and want to work with the maintainers to land a fix. Here's what you can expect to happen when you open an issue or send a pull request.
The following is adapted from the excellent Open Source Guide from GitHub and reflects how the maintainers of React Native are encouraged to handle your contributions.
@@ -39,9 +39,9 @@
Issues that do not meet the above criteria can be closed immediately, with a link to the contributor's guide.
+Issues that do not meet the above criteria can be closed immediately, with a link to the contributor's guide.
New issue runbook
-You have gathered all the information required to open a new issue, and you are confident it meets the contributor guidelines. Once you post an issue, this is what our maintainers will consider when deciding how to move forward:
+You have gathered all the information required to open a new issue, and you are confident it meets the contributor guidelines. Once you post an issue, this is what our maintainers will consider when deciding how to move forward:
What to Expect from Maintainers · React Native
EditWhat to Expect from Maintainers
So you have read through the contributor's guide and you're getting ready to send your first pull request. Perhaps you've found an issue in React Native and want to work with the maintainers to land a fix. Here's what you can expect to happen when you open an issue or send a pull request.
+ EditWhat to Expect from Maintainers
So you have read through the contributor's guide and you're getting ready to send your first pull request. Perhaps you've found an issue in React Native and want to work with the maintainers to land a fix. Here's what you can expect to happen when you open an issue or send a pull request.
The following is adapted from the excellent Open Source Guide from GitHub and reflects how the maintainers of React Native are encouraged to handle your contributions.
@@ -39,9 +39,9 @@
Issues that do not meet the above criteria can be closed immediately, with a link to the contributor's guide.
+Issues that do not meet the above criteria can be closed immediately, with a link to the contributor's guide.
New issue runbook
-You have gathered all the information required to open a new issue, and you are confident it meets the contributor guidelines. Once you post an issue, this is what our maintainers will consider when deciding how to move forward:
+You have gathered all the information required to open a new issue, and you are confident it meets the contributor guidelines. Once you post an issue, this is what our maintainers will consider when deciding how to move forward:
The alpha channel of the view rendered by the maskElement prop determines how much of the view's content and background shows through. Fully or partially opaque pixels allow the underlying content to show through but fully transparent pixels block that content.
Props
Reference
diff --git a/docs/maskedviewios/index.html b/docs/maskedviewios/index.html
index 1e0c16415fb..e4632214e48 100644
--- a/docs/maskedviewios/index.html
+++ b/docs/maskedviewios/index.html
@@ -72,10 +72,10 @@
The alpha channel of the view rendered by the maskElement prop determines how much of the view's content and background shows through. Fully or partially opaque pixels allow the underlying content to show through but fully transparent pixels block that content.
Props
Reference
diff --git a/docs/modal.html b/docs/modal.html
index 600c7690a26..7e721a8d795 100644
--- a/docs/modal.html
+++ b/docs/modal.html
@@ -82,17 +82,17 @@
Props
-
Reference
diff --git a/docs/modal/index.html b/docs/modal/index.html
index 600c7690a26..7e721a8d795 100644
--- a/docs/modal/index.html
+++ b/docs/modal/index.html
@@ -82,17 +82,17 @@
Props
-
Reference
diff --git a/docs/more-resources.html b/docs/more-resources.html
index 23ecf58bee4..50d9e05c779 100644
--- a/docs/more-resources.html
+++ b/docs/more-resources.html
@@ -41,7 +41,7 @@
Development Tools
@@ -49,7 +49,7 @@
Ignite is a starter kit that uses Redux and a few different common UI libraries. It has a CLI to generate apps, components, and containers. If you like all of the individual tech choices, Ignite could be perfect for you.
CodePush is a service from Microsoft that makes it easy to deploy live updates to your React Native app. If you don't like going through the app store process to deploy little tweaks, and you also don't like setting up your own backend, give CodePush a try.
Expo is a development environment plus application that focuses on letting you build React Native apps in the Expo development environment, without ever touching Xcode or Android Studio. If you wish React Native was even more JavaScripty and webby, check out Expo.
-The React Developer Tools are great for debugging React and React Native apps.
+The React Developer Tools are great for debugging React and React Native apps.
Where React Native People Hang Out
The forum at discuss.reactjs.org is a great place for discussion about best practices and application architecture as well as the future of React Native.
Reactiflux is a Discord chat where a lot of React-related discussion happens, including React Native. Discord is just like Slack except it works better for open source projects with a zillion contributors. Check out the #react-native channel.
diff --git a/docs/more-resources/index.html b/docs/more-resources/index.html
index 23ecf58bee4..50d9e05c779 100644
--- a/docs/more-resources/index.html
+++ b/docs/more-resources/index.html
@@ -41,7 +41,7 @@
Development Tools
@@ -49,7 +49,7 @@
Ignite is a starter kit that uses Redux and a few different common UI libraries. It has a CLI to generate apps, components, and containers. If you like all of the individual tech choices, Ignite could be perfect for you.
CodePush is a service from Microsoft that makes it easy to deploy live updates to your React Native app. If you don't like going through the app store process to deploy little tweaks, and you also don't like setting up your own backend, give CodePush a try.
Expo is a development environment plus application that focuses on letting you build React Native apps in the Expo development environment, without ever touching Xcode or Android Studio. If you wish React Native was even more JavaScripty and webby, check out Expo.
-The React Developer Tools are great for debugging React and React Native apps.
+The React Developer Tools are great for debugging React and React Native apps.
Where React Native People Hang Out
The forum at discuss.reactjs.org is a great place for discussion about best practices and application architecture as well as the future of React Native.
Reactiflux is a Discord chat where a lot of React-related discussion happens, including React Native. Discord is just like Slack except it works better for open source projects with a zillion contributors. Check out the #react-native channel.
diff --git a/docs/native-components-android.html b/docs/native-components-android.html
index 42f0d05e803..a1812013e59 100644
--- a/docs/native-components-android.html
+++ b/docs/native-components-android.html
@@ -85,7 +85,7 @@
}
4. Register the ViewManager
-The final Java step is to register the ViewManager to the application, this happens in a similar way to Native Modules, via the applications package member function createViewManagers.
+The final Java step is to register the ViewManager to the application, this happens in a similar way to Native Modules, via the applications package member function createViewManagers.
@Override
public List<ViewManager> createViewManagers(
ReactApplicationContext reactContext) {
diff --git a/docs/native-components-android/index.html b/docs/native-components-android/index.html
index 42f0d05e803..a1812013e59 100644
--- a/docs/native-components-android/index.html
+++ b/docs/native-components-android/index.html
@@ -85,7 +85,7 @@
}
4. Register the ViewManager
-The final Java step is to register the ViewManager to the application, this happens in a similar way to Native Modules, via the applications package member function createViewManagers.
+The final Java step is to register the ViewManager to the application, this happens in a similar way to Native Modules, via the applications package member function createViewManagers.
@Override
public List<ViewManager> createViewManagers(
ReactApplicationContext reactContext) {
diff --git a/docs/navigation.html b/docs/navigation.html
index f5486a99ef0..39539872f93 100644
--- a/docs/navigation.html
+++ b/docs/navigation.html
@@ -30,8 +30,8 @@
}
});
EditNavigating Between Screens
Mobile apps are rarely made up of a single screen. Managing the presentation of, and transition between, multiple screens is typically handled by what is known as a navigator.
-This guide covers the various navigation components available in React Native. If you are just getting started with navigation, you will probably want to use React Navigation. React Navigation provides an easy to use navigation solution, with the ability to present common stack navigation and tabbed navigation patterns on both iOS and Android. As this is a JavaScript implementation, it provides the greatest amount of configurability as well as flexibility when integrating with state management libraries such as redux.
-If you're only targeting iOS, you may want to also check out NavigatorIOS as a way of providing a native look and feel with minimal configuration, as it provides a wrapper around the native UINavigationController class. This component will not work on Android, however.
+This guide covers the various navigation components available in React Native. If you are just getting started with navigation, you will probably want to use React Navigation. React Navigation provides an easy to use navigation solution, with the ability to present common stack navigation and tabbed navigation patterns on both iOS and Android. As this is a JavaScript implementation, it provides the greatest amount of configurability as well as flexibility when integrating with state management libraries such as redux.
+If you're only targeting iOS, you may want to also check out NavigatorIOS as a way of providing a native look and feel with minimal configuration, as it provides a wrapper around the native UINavigationController class. This component will not work on Android, however.
If you'd like to achieve a native look and feel on both iOS and Android, or you're integrating React Native into an app that already manages navigation natively, the following libraries provide native navigation on both platforms: native-navigation, react-native-navigation.
React Navigation
The community solution to navigation is a standalone library that allows developers to set up the screens of an app with just a few lines of code.
@@ -69,7 +69,7 @@ export default App;
}
React Navigation routers make it easy to override navigation logic or integrate it into redux. Because routers can be nested inside each other, developers can override navigation logic for one area of the app without making widespread changes.
-The views in React Navigation use native components and the Animated library to deliver 60fps animations that are run on the native thread. Plus, the animations and gestures can be easily customized.
+The views in React Navigation use native components and the Animated library to deliver 60fps animations that are run on the native thread. Plus, the animations and gestures can be easily customized.
For a complete intro to React Navigation, follow the React Navigation Getting Started Guide, or browse other docs such as the Intro to Navigators.
NavigatorIOS
NavigatorIOS looks and feels just like UINavigationController, because it is actually built on top of it.
@@ -138,7 +138,7 @@ class MyScene extends React.Component {
}
}
-Check out the NavigatorIOS reference docs to learn more about this component.
+Check out the NavigatorIOS reference docs to learn more about this component.
EditNavigating Between Screens
Mobile apps are rarely made up of a single screen. Managing the presentation of, and transition between, multiple screens is typically handled by what is known as a navigator.
-This guide covers the various navigation components available in React Native. If you are just getting started with navigation, you will probably want to use React Navigation. React Navigation provides an easy to use navigation solution, with the ability to present common stack navigation and tabbed navigation patterns on both iOS and Android. As this is a JavaScript implementation, it provides the greatest amount of configurability as well as flexibility when integrating with state management libraries such as redux.
-If you're only targeting iOS, you may want to also check out NavigatorIOS as a way of providing a native look and feel with minimal configuration, as it provides a wrapper around the native UINavigationController class. This component will not work on Android, however.
+This guide covers the various navigation components available in React Native. If you are just getting started with navigation, you will probably want to use React Navigation. React Navigation provides an easy to use navigation solution, with the ability to present common stack navigation and tabbed navigation patterns on both iOS and Android. As this is a JavaScript implementation, it provides the greatest amount of configurability as well as flexibility when integrating with state management libraries such as redux.
+If you're only targeting iOS, you may want to also check out NavigatorIOS as a way of providing a native look and feel with minimal configuration, as it provides a wrapper around the native UINavigationController class. This component will not work on Android, however.
If you'd like to achieve a native look and feel on both iOS and Android, or you're integrating React Native into an app that already manages navigation natively, the following libraries provide native navigation on both platforms: native-navigation, react-native-navigation.
React Navigation
The community solution to navigation is a standalone library that allows developers to set up the screens of an app with just a few lines of code.
@@ -69,7 +69,7 @@ export default App;
}
React Navigation routers make it easy to override navigation logic or integrate it into redux. Because routers can be nested inside each other, developers can override navigation logic for one area of the app without making widespread changes.
-The views in React Navigation use native components and the Animated library to deliver 60fps animations that are run on the native thread. Plus, the animations and gestures can be easily customized.
+The views in React Navigation use native components and the Animated library to deliver 60fps animations that are run on the native thread. Plus, the animations and gestures can be easily customized.
For a complete intro to React Navigation, follow the React Navigation Getting Started Guide, or browse other docs such as the Intro to Navigators.
NavigatorIOS
NavigatorIOS looks and feels just like UINavigationController, because it is actually built on top of it.
@@ -138,7 +138,7 @@ class MyScene extends React.Component {
}
}
-Check out the NavigatorIOS reference docs to learn more about this component.
+Check out the NavigatorIOS reference docs to learn more about this component.
EditPanResponder
PanResponder reconciles several touches into a single gesture. It makes single-touch gestures resilient to extra touches, and can be used to recognize simple multi-touch gestures.
By default, PanResponder holds an InteractionManager handle to block long-running JS events from interrupting active gestures.
-It provides a predictable wrapper of the responder handlers provided by the gesture responder system. For each handler, it provides a new gestureState object alongside the native event object:
+It provides a predictable wrapper of the responder handlers provided by the gesture responder system. For each handler, it provides a new gestureState object alongside the native event object:
onPanResponderMove: (event, gestureState) => {}
A native event is a synthetic touch event with the following form:
@@ -113,7 +113,7 @@
To see it in action, try the PanResponder example in RNTester
Methods
Reference
diff --git a/docs/panresponder/index.html b/docs/panresponder/index.html
index 2357f082ff4..bfacf77dac2 100644
--- a/docs/panresponder/index.html
+++ b/docs/panresponder/index.html
@@ -31,7 +31,7 @@
});
EditPanResponder
PanResponder reconciles several touches into a single gesture. It makes single-touch gestures resilient to extra touches, and can be used to recognize simple multi-touch gestures.
By default, PanResponder holds an InteractionManager handle to block long-running JS events from interrupting active gestures.
-It provides a predictable wrapper of the responder handlers provided by the gesture responder system. For each handler, it provides a new gestureState object alongside the native event object:
+It provides a predictable wrapper of the responder handlers provided by the gesture responder system. For each handler, it provides a new gestureState object alongside the native event object:
onPanResponderMove: (event, gestureState) => {}
A native event is a synthetic touch event with the following form:
@@ -113,7 +113,7 @@
To see it in action, try the PanResponder example in RNTester
Methods
Reference
diff --git a/docs/performance.html b/docs/performance.html
index 00be9dd8421..667f8c0c2a0 100644
--- a/docs/performance.html
+++ b/docs/performance.html
@@ -30,7 +30,7 @@
}
});
EditPerformance
A compelling reason for using React Native instead of WebView-based tools is to achieve 60 frames per second and a native look and feel to your apps. Where possible, we would like for React Native to do the right thing and help you to focus on your app instead of performance optimization, but there are areas where we're not quite there yet, and others where React Native (similar to writing native code directly) cannot possibly determine the best way to optimize for you and so manual intervention will be necessary. We try our best to deliver buttery-smooth UI performance by default, but sometimes that just isn't possible.
-This guide is intended to teach you some basics to help you to troubleshoot performance issues, as well as discuss common sources of problems and their suggested solutions.
+This guide is intended to teach you some basics to help you to troubleshoot performance issues, as well as discuss common sources of problems and their suggested solutions.
What you need to know about frames
Your grandparents' generation called movies "moving pictures" for a reason: realistic motion in video is an illusion created by quickly changing static images at a consistent speed. We refer to each of these images as frames. The number of frames that is displayed each second has a direct impact on how smooth and ultimately life-like a video (or user interface) seems to be. iOS devices display 60 frames per second, which gives you and the UI system about 16.67ms to do all of the work needed to generate the static image (frame) that the user will see on the screen for that interval. If you are unable to do the work necessary to generate that frame within the allotted 16.67ms, then you will "drop a frame" and the UI will appear unresponsive.
Now to confuse the matter a little bit, open up the developer menu in your app and toggle Show Perf Monitor. You will notice that there are two different frame rates.
@@ -44,7 +44,7 @@
Similarly, you can happily scroll up and down through a ScrollView when the JavaScript thread is locked up because the ScrollView lives on the main thread. The scroll events are dispatched to the JS thread, but their receipt is not necessary for the scroll to occur.
Common sources of performance problems
Running in development mode (dev=true)
-JavaScript thread performance suffers greatly when running in dev mode. This is unavoidable: a lot more work needs to be done at runtime to provide you with good warnings and error messages, such as validating propTypes and various other assertions. Always make sure to test performance in release builds.
+JavaScript thread performance suffers greatly when running in dev mode. This is unavoidable: a lot more work needs to be done at runtime to provide you with good warnings and error messages, such as validating propTypes and various other assertions. Always make sure to test performance in release builds.
Using console.log statements
When running a bundled app, these statements can cause a big bottleneck in the JavaScript thread. This includes calls from debugging libraries such as redux-logger, so make sure to remove them before bundling. You can also use this babel plugin that removes all the console.* calls. You need to install it first with npm i babel-plugin-transform-remove-console --save-dev, and then edit the .babelrc file under your project directory like this:
{
@@ -57,8 +57,8 @@
This will automatically remove all console.* calls in the release (production) versions of your project.
ListView initial rendering is too slow or scroll performance is bad for large lists
-Use the new FlatList or SectionList component instead. Besides simplifying the API, the new list components also have significant performance enhancements, the main one being nearly constant memory usage for any number of rows.
-If your FlatList is rendering slow, be sure that you've implemented getItemLayout to optimize rendering speed by skipping measurement of the rendered items.
+Use the new FlatList or SectionList component instead. Besides simplifying the API, the new list components also have significant performance enhancements, the main one being nearly constant memory usage for any number of rows.
+If your FlatList is rendering slow, be sure that you've implemented getItemLayout to optimize rendering speed by skipping measurement of the rendered items.
JS FPS plunges when re-rendering a view that hardly changes
If you are using a ListView, you must provide a rowHasChanged function that can reduce a lot of work by quickly determining whether or not a row needs to be re-rendered. If you are using immutable data structures, this would be as simple as a reference equality check.
Similarly, you can implement shouldComponentUpdate and indicate the exact conditions under which you would like the component to re-render. If you write pure components (where the return value of the render function is entirely dependent on props and state), you can leverage PureComponent to do this for you. Once again, immutable data structures are useful to keep this fast -- if you have to do a deep comparison of a large list of objects, it may be that re-rendering your entire component would be quicker, and it would certainly require less code.
@@ -91,11 +91,11 @@
One solution to this is to allow for JavaScript-based animations to be offloaded to the main thread. If we were to do the same thing as in the above example with this approach, we might calculate a list of all x-offsets for the new scene when we are starting the transition and send them to the main thread to execute in an optimized way. Now that the JavaScript thread is freed of this responsibility, it's not a big deal if it drops a few frames while rendering the scene -- you probably won't even notice because you will be too distracted by the pretty transition.
-Solving this is one of the main goals behind the new React Navigation library. The views in React Navigation use native components and the Animated library to deliver 60 FPS animations that are run on the native thread.
+Solving this is one of the main goals behind the new React Navigation library. The views in React Navigation use native components and the Animated library to deliver 60 FPS animations that are run on the native thread.
Profiling
Use the built-in profiler to get detailed information about work done in the JavaScript thread and main thread side-by-side. Access it by selecting Perf Monitor from the Debug menu.
-For iOS, Instruments is an invaluable tool, and on Android you should learn to use systrace.
-But first, make sure that Development Mode is OFF! You should see __DEV__ === false, development-level warning are OFF, performance optimizations are ON in your application logs.
+For iOS, Instruments is an invaluable tool, and on Android you should learn to use systrace.
+But first, make sure that Development Mode is OFF! You should see __DEV__ === false, development-level warning are OFF, performance optimizations are ON in your application logs.
Another way to profile JavaScript is to use the Chrome profiler while debugging. This won't give you accurate results as the code is running in Chrome but will give you a general idea of where bottlenecks might be. Run the profiler under Chrome's Performance tab. A flame graph will appear under User Timing. To view more details in tabular format, click at the Bottom Up tab below and then select DedicatedWorker Thread at the top left menu.
Profiling Android UI Performance with systrace
Android supports 10k+ different phones and is generalized to support software rendering: the framework architecture and need to generalize across many hardware targets unfortunately means you get less for free relative to iOS. But sometimes, there are things you can improve -- and many times it's not native code's fault at all!
diff --git a/docs/performance/index.html b/docs/performance/index.html
index 00be9dd8421..667f8c0c2a0 100644
--- a/docs/performance/index.html
+++ b/docs/performance/index.html
@@ -30,7 +30,7 @@
}
});
EditPerformance
A compelling reason for using React Native instead of WebView-based tools is to achieve 60 frames per second and a native look and feel to your apps. Where possible, we would like for React Native to do the right thing and help you to focus on your app instead of performance optimization, but there are areas where we're not quite there yet, and others where React Native (similar to writing native code directly) cannot possibly determine the best way to optimize for you and so manual intervention will be necessary. We try our best to deliver buttery-smooth UI performance by default, but sometimes that just isn't possible.
-This guide is intended to teach you some basics to help you to troubleshoot performance issues, as well as discuss common sources of problems and their suggested solutions.
+This guide is intended to teach you some basics to help you to troubleshoot performance issues, as well as discuss common sources of problems and their suggested solutions.
