mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
update website
This commit is contained in:
@@ -9,7 +9,7 @@ there is any. Returns a <code>Promise</code> object.</p></div></div><div class="
|
||||
don't want to call this - use removeItem or multiRemove to clear only your
|
||||
own keys instead. Returns a <code>Promise</code> object.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="getallkeys"></a><span class="propType">static </span>getAllKeys<span class="propType">(callback?: ?(error: ?Error, keys: ?Array<string>) => void)</span> <a class="hash-link" href="#getallkeys">#</a></h4><div><p>Gets <em>all</em> keys known to the app, for all callers, libraries, etc. Returns a <code>Promise</code> object.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="multiget"></a><span class="propType">static </span>multiGet<span class="propType">(keys: Array<string>, callback?: ?(errors: ?Array<Error>, result: ?Array<Array<string>>) => void)</span> <a class="hash-link" href="#multiget">#</a></h4><div><p>multiGet invokes callback with an array of key-value pair arrays that
|
||||
matches the input format of multiSet. Returns a <code>Promise</code> object.</p><p> multiGet(['k1', 'k2'], cb) -> cb([['k1', 'val1'], ['k2', 'val2']])</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="multiset"></a><span class="propType">static </span>multiSet<span class="propType">(keyValuePairs: Array<Array<string>>, callback?: ?(errors: ?Array<Error>) => void)</span> <a class="hash-link" href="#multiset">#</a></h4><div><p>multiSet and multiMerge take arrays of key-value array pairs that match
|
||||
the output of multiGet. Returns a <code>Promise</code> object.</p><p> multiSet([['k1', 'val1'], ['k2', 'val2']], cb);</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="multiremove"></a><span class="propType">static </span>multiRemove<span class="propType">(keys: Array<string>, callback?: ?(errors: ?Array<Error>) => void)</span> <a class="hash-link" href="#multiremove">#</a></h4><div><p>Delete all the keys in the <code>keys</code> array. Returns a <code>Promise</code> object.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="multimerge"></a><span class="propType">static </span>multiMerge<span class="propType">(keyValuePairs: Array<Array<string>>, callback?: ?(errors: ?Array<Error>) => void)</span> <a class="hash-link" href="#multimerge">#</a></h4><div><p>Merges existing values with input values, assuming they are stringified
|
||||
the output of multiGet, e.g. Returns a <code>Promise</code> object.</p><p> multiSet([['k1', 'val1'], ['k2', 'val2']], cb);</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="multiremove"></a><span class="propType">static </span>multiRemove<span class="propType">(keys: Array<string>, callback?: ?(errors: ?Array<Error>) => void)</span> <a class="hash-link" href="#multiremove">#</a></h4><div><p>Delete all the keys in the <code>keys</code> array. Returns a <code>Promise</code> object.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="multimerge"></a><span class="propType">static </span>multiMerge<span class="propType">(keyValuePairs: Array<Array<string>>, callback?: ?(errors: ?Array<Error>) => void)</span> <a class="hash-link" href="#multimerge">#</a></h4><div><p>Merges existing values with input values, assuming they are stringified
|
||||
json. Returns a <code>Promise</code> object.</p><p>Not supported by all native implementations.</p></div></div></div></span></div><div><h3><a class="anchor" name="examples"></a><a class="edit-github" href="https://github.com/facebook/react-native/blob/master/Examples/UIExplorer/AsyncStorageExample.js">Edit on GitHub</a>Examples <a class="hash-link" href="#examples">#</a></h3><div class="prism language-javascript"><span class="token string">'use strict'</span><span class="token punctuation">;</span>
|
||||
|
||||
<span class="token keyword">var</span> React <span class="token operator">=</span> <span class="token function">require<span class="token punctuation">(</span></span><span class="token string">'react-native'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||||
|
||||
@@ -5,7 +5,7 @@ recognize simple multi-touch gestures.</p><p>It provides a predictable wrapper o
|
||||
For each handler, it provides a new <code>gestureState</code> object alongside the
|
||||
normal event.</p><p>A <code>gestureState</code> object has the following:</p><ul><li><code>stateID</code> - ID of the gestureState- persisted as long as there at least
|
||||
one touch on screen</li><li><code>moveX</code> - the latest screen coordinates of the recently-moved touch</li><li><code>moveY</code> - the latest screen coordinates of the recently-moved touch</li><li><code>x0</code> - the screen coordinates of the responder grant</li><li><code>y0</code> - the screen coordinates of the responder grant</li><li><code>dx</code> - accumulated distance of the gesture since the touch started</li><li><code>dy</code> - accumulated distance of the gesture since the touch started</li><li><code>vx</code> - current velocity of the gesture</li><li><code>vy</code> - current velocity of the gesture</li><li><code>numberActiveTouches</code> - Number of touches currently on screeen</li></ul><h3><a class="anchor" name="basic-usage"></a>Basic Usage <a class="hash-link" href="#basic-usage">#</a></h3><div class="prism language-javascript"> componentWillMount<span class="token punctuation">:</span> <span class="token keyword">function</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
|
||||
<span class="token keyword">this</span><span class="token punctuation">.</span>_panResponder <span class="token operator">=</span> PanResponder<span class="token punctuation">.</span><span class="token function">create<span class="token punctuation">(</span></span><span class="token punctuation">{</span>
|
||||
<span class="token keyword">this</span><span class="token punctuation">.</span>_panGesture <span class="token operator">=</span> PanResponder<span class="token punctuation">.</span><span class="token function">create<span class="token punctuation">(</span></span><span class="token punctuation">{</span>
|
||||
<span class="token comment" spellcheck="true"> // Ask to be the responder:
|
||||
</span> onStartShouldSetPanResponder<span class="token punctuation">:</span> <span class="token punctuation">(</span>evt<span class="token punctuation">,</span> gestureState<span class="token punctuation">)</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token boolean">true</span><span class="token punctuation">,</span>
|
||||
onStartShouldSetPanResponderCapture<span class="token punctuation">:</span> <span class="token punctuation">(</span>evt<span class="token punctuation">,</span> gestureState<span class="token punctuation">)</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token boolean">true</span><span class="token punctuation">,</span>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<span class="token keyword">var</span> SwitchAndroidExample <span class="token operator">=</span> React<span class="token punctuation">.</span><span class="token function">createClass<span class="token punctuation">(</span></span><span class="token punctuation">{</span>
|
||||
statics<span class="token punctuation">:</span> <span class="token punctuation">{</span>
|
||||
title<span class="token punctuation">:</span> <span class="token string">'<SwitchAndroid>'</span><span class="token punctuation">,</span>
|
||||
description<span class="token punctuation">:</span> <span class="token string">'Standard Android two-state toggle component'</span>
|
||||
description<span class="token punctuation">:</span> <span class="token string">'Standard Android two-state toggle component.'</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||||
|
||||
getInitialState <span class="token punctuation">:</span> <span class="token keyword">function</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
|
||||
|
||||
@@ -16,7 +16,7 @@ which takes the following parameters:</p><ol><li>String message: A string with t
|
||||
|
||||
statics<span class="token punctuation">:</span> <span class="token punctuation">{</span>
|
||||
title<span class="token punctuation">:</span> <span class="token string">'Toast Example'</span><span class="token punctuation">,</span>
|
||||
description<span class="token punctuation">:</span> <span class="token string">'Toast Example'</span><span class="token punctuation">,</span>
|
||||
description<span class="token punctuation">:</span> <span class="token string">'Example that demostrates the use of an Android Toast to provide feedback.'</span><span class="token punctuation">,</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||||
|
||||
getInitialState<span class="token punctuation">:</span> <span class="token keyword">function</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
|
||||
|
||||
@@ -10,7 +10,7 @@ easy to add to an app without weird side-effects.</p><p>Example:</p><div class="
|
||||
<span class="token operator">/</span><span class="token operator">></span>
|
||||
<<span class="token operator">/</span>TouchableOpacity<span class="token operator">></span>
|
||||
<span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">,</span></div><blockquote><p><strong>NOTE</strong>: TouchableOpacity supports only one child</p><p>If you wish to have to have several child components, wrap them in a View.</p></blockquote></div><h3><a class="anchor" name="props"></a><a class="edit-github" href="https://github.com/facebook/react-native/blob/master/Libraries/Components/Touchable/TouchableOpacity.js">Edit on GitHub</a>Props <a class="hash-link" href="#props">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="activeopacity"></a>activeOpacity <span class="propType">number</span> <a class="hash-link" href="#activeopacity">#</a></h4><div><p>Determines what the opacity of the wrapped view should be when touch is
|
||||
<span class="token punctuation">}</span><span class="token punctuation">,</span></div></div><h3><a class="anchor" name="props"></a><a class="edit-github" href="https://github.com/facebook/react-native/blob/master/Libraries/Components/Touchable/TouchableOpacity.js">Edit on GitHub</a>Props <a class="hash-link" href="#props">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="activeopacity"></a>activeOpacity <span class="propType">number</span> <a class="hash-link" href="#activeopacity">#</a></h4><div><p>Determines what the opacity of the wrapped view should be when touch is
|
||||
active.</p></div></div></div></div><div class="docs-prevnext"><a class="docs-next" href="touchablewithoutfeedback.html#content">Next →</a></div></div></section><footer class="wrap"><div class="right">© 2015 Facebook Inc.</div></footer></div><div id="fb-root"></div><script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
|
||||
Reference in New Issue
Block a user