Picker#onValueChange

onValueChange function Callback for when an item is selected. This is called with the following parameters: - itemValue: the value prop of the item that was selected - itemPosition: the index of the selected item in this picker

Picker#enabled

androidenabled bool If set to false, the picker will be disabled, i.e. the user will not be able to make a selection.

Performance

A compelling reason for using React Native instead of WebView-based tools is to achieve 60 FPS and a native look & 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 ne

PanResponder.create()

static create(config) @param {object} config Enhanced versions of all of the responder callbacks that provide not only the typical ResponderSyntheticEvent, but also the PanResponder gesture state. Simply replace the word Responder with PanResponder in each of the typical onResponder* callbacks. For example, the config object would look like: onMoveShouldSetPanResponder: (e, gestureState) => {...} onMoveShouldSetPanResponderCapture: (e, gestureState) => {...} onStartShouldSetPanResponde

NetInfo.removeEventListener()

static removeEventListener(eventName, handler) Removes the listener for network status changes.

NetInfo.isConnectionExpensive()

isConnectionExpensive Available on Android. Detect if the current active connection is metered or not. A network is classified as metered when the user is sensitive to heavy data usage on that connection due to monetary costs, data limitations or battery/performance issues. NetInfo.isConnectionExpensive() .then(isConnectionExpensive => { console.log('Connection is ' + (isConnectionExpensive ? 'Expensive' : 'Not Expensive')); }) .catch(error => { console.error(error); });

Network

One of React Native's goals is to be a playground where we can experiment with different architectures and crazy ideas. Since browsers are not flexible enough, we had no choice but to reimplement the entire stack. In the places that we did not intend to change anything, we tried to be as faithful as possible to the browser APIs. The networking stack is a great example. Fetch fetch is a better networking API being worked on by the standards committee and is already available in Chrome. It is a

NetInfo.addEventListener()

static addEventListener(eventName, handler) Invokes the listener whenever network status changes. The listener receives one of the connectivity types listed above.

NetInfo#isConnected

isConnected Available on all platforms. Asynchronously fetch a boolean to determine internet connectivity. NetInfo.isConnected.fetch().then(isConnected => { console.log('First, is ' + (isConnected ? 'online' : 'offline')); }); function handleFirstConnectivityChange(isConnected) { console.log('Then, is ' + (isConnected ? 'online' : 'offline')); NetInfo.isConnected.removeEventListener( 'change', handleFirstConnectivityChange ); } NetInfo.isConnected.addEventListener( 'change

NetInfo.fetch()

static fetch() Returns a promise that resolves with one of the connectivity types listed above.