From efda04dad67a2ec8072a1e7e1b13d5a94b8c3f2d Mon Sep 17 00:00:00 2001 From: Travis CI Date: Fri, 1 Jan 2016 02:43:11 +0000 Subject: [PATCH] update website --- docs/direct-manipulation.html | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/docs/direct-manipulation.html b/docs/direct-manipulation.html index dea7d220666..3edd5057b97 100644 --- a/docs/direct-manipulation.html +++ b/docs/direct-manipulation.html @@ -98,29 +98,7 @@ child perform touch handling. To do this, it passes on Precomputing style #

We learned above that setNativeProps is a wrapper around -RCTUIManager.updateView, which is also used internally by React to -perform updates on re-render. One important difference is that -setNativeProps does not call precomputeStyle, which is done -internally by React, and so the transform property will not work if -you try to update it manually with setNativeProps. To fix this, -you can call precomputeStyle on your object first:

var precomputeStyle = require('precomputeStyle'); - -var App = React.createClass({ - componentDidMount() { - var nativeProps = precomputeStyle({transform: [{rotate: '45deg'}]}); - this._root.setNativeProps(nativeProps); - }, - - render() { - return ( - <View ref={component => this._root = component} - style={styles.container}> - <Text>Precompute style!</Text> - </View> - ) - }, -});

Run this example

setNativeProps to clear TextInput value #

Another very common use case of setNativeProps is to clear the value +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