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:
File diff suppressed because one or more lines are too long
+1
-80
File diff suppressed because one or more lines are too long
+1
-94
@@ -4,100 +4,7 @@ root components should register themselves with
|
||||
for the app and then actually run the app when it's ready by invoking
|
||||
<code>AppRegistry.runApplication</code>.</p><p><code>AppRegistry</code> should be <code>require</code>d early in the <code>require</code> sequence to make
|
||||
sure the JS execution environment is setup before other modules are
|
||||
<code>require</code>d.</p></div><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="registerconfig"></a><span class="propType">static </span>registerConfig(<span class="propType">config</span>) <a class="hash-link" href="#registerconfig">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="registercomponent"></a><span class="propType">static </span>registerComponent(<span class="propType">appKey, getComponentFunc</span>) <a class="hash-link" href="#registercomponent">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="registerrunnable"></a><span class="propType">static </span>registerRunnable(<span class="propType">appKey, func</span>) <a class="hash-link" href="#registerrunnable">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="runapplication"></a><span class="propType">static </span>runApplication(<span class="propType">appKey, appParameters</span>) <a class="hash-link" href="#runapplication">#</a></h4></div></div><pre>{
|
||||
"methods": [
|
||||
{
|
||||
"line": 31,
|
||||
"source": "registerConfig: function(config) {\n for (var i = 0; i < config.length; ++i) {\n if (config[i].run) {\n AppRegistry.registerRunnable(config[i].appKey, config[i].run);\n } else {\n AppRegistry.registerComponent(config[i].appKey, config[i].component);\n }\n }\n }",
|
||||
"modifiers": [
|
||||
"static"
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"typehint": null,
|
||||
"name": "config"
|
||||
}
|
||||
],
|
||||
"tparams": null,
|
||||
"returntypehint": null,
|
||||
"name": "registerConfig"
|
||||
},
|
||||
{
|
||||
"line": 41,
|
||||
"source": "registerComponent: function(appKey, getComponentFunc) {\n runnables[appKey] = {\n run: (appParameters) =>\n renderApplication(getComponentFunc(), appParameters.initialProps, appParameters.rootTag)\n };\n return appKey;\n }",
|
||||
"modifiers": [
|
||||
"static"
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"typehint": null,
|
||||
"name": "appKey"
|
||||
},
|
||||
{
|
||||
"typehint": null,
|
||||
"name": "getComponentFunc"
|
||||
}
|
||||
],
|
||||
"tparams": null,
|
||||
"returntypehint": null,
|
||||
"name": "registerComponent"
|
||||
},
|
||||
{
|
||||
"line": 49,
|
||||
"source": "registerRunnable: function(appKey, func) {\n runnables[appKey] = {run: func};\n return appKey;\n }",
|
||||
"modifiers": [
|
||||
"static"
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"typehint": null,
|
||||
"name": "appKey"
|
||||
},
|
||||
{
|
||||
"typehint": null,
|
||||
"name": "func"
|
||||
}
|
||||
],
|
||||
"tparams": null,
|
||||
"returntypehint": null,
|
||||
"name": "registerRunnable"
|
||||
},
|
||||
{
|
||||
"line": 54,
|
||||
"source": "runApplication: function(appKey, appParameters) {\n console.log(\n 'Running application \"' + appKey + '\" with appParams: ' +\n JSON.stringify(appParameters) + '. ' +\n '__DEV__ === ' + __DEV__ +\n ', development-level warning are ' + (__DEV__ ? 'ON' : 'OFF') +\n ', performance optimizations are ' + (__DEV__ ? 'OFF' : 'ON')\n );\n invariant(\n runnables[appKey] && runnables[appKey].run,\n 'Application ' + appKey + ' has not been registered.'\n );\n runnables[appKey].run(appParameters);\n }",
|
||||
"modifiers": [
|
||||
"static"
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"typehint": null,
|
||||
"name": "appKey"
|
||||
},
|
||||
{
|
||||
"typehint": null,
|
||||
"name": "appParameters"
|
||||
}
|
||||
],
|
||||
"tparams": null,
|
||||
"returntypehint": null,
|
||||
"name": "runApplication"
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"superClass": null,
|
||||
"type": "api",
|
||||
"line": 30,
|
||||
"name": "AppRegistry",
|
||||
"docblock": "/**\n * `AppRegistry` is the JS entry point to running all React Native apps. App\n * root components should register themselves with\n * `AppRegistry.registerComponent`, then the native system can load the bundle\n * for the app and then actually run the app when it's ready by invoking\n * `AppRegistry.runApplication`.\n *\n * `AppRegistry` should be `require`d early in the `require` sequence to make\n * sure the JS execution environment is setup before other modules are\n * `require`d.\n */\n",
|
||||
"requires": [
|
||||
{
|
||||
"name": "invariant"
|
||||
},
|
||||
{
|
||||
"name": "renderApplication"
|
||||
}
|
||||
]
|
||||
}</pre></div><noscript></noscript><div class="docs-prevnext"><a class="docs-next" href="appstate.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>
|
||||
<code>require</code>d.</p></div><h3><a class="anchor" name="methods"></a>Methods <a class="hash-link" href="#methods">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="registerconfig"></a><span class="propType">static </span>registerConfig(<span class="propType">config</span>) <a class="hash-link" href="#registerconfig">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="registercomponent"></a><span class="propType">static </span>registerComponent(<span class="propType">appKey, getComponentFunc</span>) <a class="hash-link" href="#registercomponent">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="registerrunnable"></a><span class="propType">static </span>registerRunnable(<span class="propType">appKey, func</span>) <a class="hash-link" href="#registerrunnable">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="runapplication"></a><span class="propType">static </span>runApplication(<span class="propType">appKey, appParameters</span>) <a class="hash-link" href="#runapplication">#</a></h4></div></div></div><noscript></noscript><div class="docs-prevnext"><a class="docs-next" href="appstate.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),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
|
||||
+1
-56
File diff suppressed because one or more lines are too long
+1
-59
File diff suppressed because one or more lines are too long
+5
-228
@@ -2,237 +2,14 @@
|
||||
system. It should be used instead of LocalStorage.</p><p>It is recommended that you use an abstraction on top of AsyncStorage instead
|
||||
of AsyncStorage directly for anything more than light usage since it
|
||||
operates globally.</p><p>This JS code is a simple facad over the native iOS implementation to provide
|
||||
a clear JS API, real Error objects, and simple non-multi functions.</p></div><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="getitem"></a><span class="propType">static </span>getItem(<span class="propType">key: string, callback: (error: ?Error, result: ?string) => void</span>) <a class="hash-link" href="#getitem">#</a></h4><div><p>Fetches <code>key</code> and passes the result to <code>callback</code>, along with an <code>Error</code> if
|
||||
a clear JS API, real Error objects, and simple non-multi functions.</p></div><h3><a class="anchor" name="methods"></a>Methods <a class="hash-link" href="#methods">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="getitem"></a><span class="propType">static </span>getItem(<span class="propType">key: string, callback: (error: ?Error, result: ?string) => void</span>) <a class="hash-link" href="#getitem">#</a></h4><div><p>Fetches <code>key</code> and passes the result to <code>callback</code>, along with an <code>Error</code> if
|
||||
there is any.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="setitem"></a><span class="propType">static </span>setItem(<span class="propType">key: string, value: string, callback: ?(error: ?Error) => void</span>) <a class="hash-link" href="#setitem">#</a></h4><div><p>Sets <code>value</code> for <code>key</code> and calls <code>callback</code> on completion, along with an
|
||||
<code>Error</code> if there is any.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="removeitem"></a><span class="propType">static </span>removeItem(<span class="propType">key: string, callback: ?(error: ?Error) => void</span>) <a class="hash-link" href="#removeitem">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="mergeitem"></a><span class="propType">static </span>mergeItem(<span class="propType">key: string, value: string, callback: ?(error: ?Error) => void</span>) <a class="hash-link" href="#mergeitem">#</a></h4><div><p>Merges existing value with input value, assuming they are stringified json.</p><p>Not supported by all native implementations.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="clear"></a><span class="propType">static </span>clear(<span class="propType">callback: ?(error: ?Error) => void</span>) <a class="hash-link" href="#clear">#</a></h4><div><p>Erases <em>all</em> AsyncStorage for all clients, libraries, etc. You probably
|
||||
don't want to call this - use removeItem or multiRemove to clear only your
|
||||
own keys instead.</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) => void</span>) <a class="hash-link" href="#getallkeys">#</a></h4><div><p>Gets <em>all</em> keys known to the system, for all callers, libraries, etc.</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: :({"type":"generic","value":[{"type":"simple","value":"Array","length":1},{"type":"simple","value":"string","length":1}],"length":4}, 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.</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: :({"type":"generic","value":[{"type":"simple","value":"Array","length":1},{"type":"generic","value":[{"type":"simple","value":"Array","length":1},{"type":"simple","value":"string","length":1}],"length":4}],"length":7}, 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, e.g.</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: :({"type":"generic","value":[{"type":"simple","value":"Array","length":1},{"type":"simple","value":"string","length":1}],"length":4}, 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.</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: :({"type":"generic","value":[{"type":"simple","value":"Array","length":1},{"type":"generic","value":[{"type":"simple","value":"Array","length":1},{"type":"simple","value":"string","length":1}],"length":4}],"length":7}, 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.</p><p>Not supported by all native implementations.</p></div></div></div><pre>{
|
||||
"methods": [
|
||||
{
|
||||
"line": 32,
|
||||
"source": "getItem: function(\n key: string,\n callback: (error: ?Error, result: ?string) => void\n ): void {\n RKAsyncStorage.multiGet([key], function(errors, result) {\n // Unpack result to get value from [[key,value]]\n var value = (result && result[0] && result[0][1]) ? result[0][1] : null;\n callback((errors && convertError(errors[0])) || null, value);\n });\n }",
|
||||
"docblock": "/**\n * Fetches `key` and passes the result to `callback`, along with an `Error` if\n * there is any.\n */\n",
|
||||
"modifiers": [
|
||||
"static"
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"typehint": "{\"type\":\"simple\",\"value\":\"string\",\"length\":1}",
|
||||
"name": "key"
|
||||
},
|
||||
{
|
||||
"typehint": "(error: ?Error, result: ?string) => void",
|
||||
"name": "callback"
|
||||
}
|
||||
],
|
||||
"tparams": null,
|
||||
"returntypehint": "void",
|
||||
"name": "getItem"
|
||||
},
|
||||
{
|
||||
"line": 47,
|
||||
"source": "setItem: function(\n key: string,\n value: string,\n callback: ?(error: ?Error) => void\n ): void {\n RKAsyncStorage.multiSet([[key,value]], function(errors) {\n callback && callback((errors && convertError(errors[0])) || null);\n });\n }",
|
||||
"docblock": "/**\n * Sets `value` for `key` and calls `callback` on completion, along with an\n * `Error` if there is any.\n */\n",
|
||||
"modifiers": [
|
||||
"static"
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"typehint": "{\"type\":\"simple\",\"value\":\"string\",\"length\":1}",
|
||||
"name": "key"
|
||||
},
|
||||
{
|
||||
"typehint": "{\"type\":\"simple\",\"value\":\"string\",\"length\":1}",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"typehint": "?(error: ?Error) => void",
|
||||
"name": "callback"
|
||||
}
|
||||
],
|
||||
"tparams": null,
|
||||
"returntypehint": "void",
|
||||
"name": "setItem"
|
||||
},
|
||||
{
|
||||
"line": 57,
|
||||
"source": "removeItem: function(\n key: string,\n callback: ?(error: ?Error) => void\n ): void {\n RKAsyncStorage.multiRemove([key], function(errors) {\n callback && callback((errors && convertError(errors[0])) || null);\n });\n }",
|
||||
"modifiers": [
|
||||
"static"
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"typehint": "{\"type\":\"simple\",\"value\":\"string\",\"length\":1}",
|
||||
"name": "key"
|
||||
},
|
||||
{
|
||||
"typehint": "?(error: ?Error) => void",
|
||||
"name": "callback"
|
||||
}
|
||||
],
|
||||
"tparams": null,
|
||||
"returntypehint": "void",
|
||||
"name": "removeItem"
|
||||
},
|
||||
{
|
||||
"line": 71,
|
||||
"source": "mergeItem: function(\n key: string,\n value: string,\n callback: ?(error: ?Error) => void\n ): void {\n RKAsyncStorage.multiMerge([[key,value]], function(errors) {\n callback && callback((errors && convertError(errors[0])) || null);\n });\n }",
|
||||
"docblock": "/**\n * Merges existing value with input value, assuming they are stringified json.\n *\n * Not supported by all native implementations.\n */\n",
|
||||
"modifiers": [
|
||||
"static"
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"typehint": "{\"type\":\"simple\",\"value\":\"string\",\"length\":1}",
|
||||
"name": "key"
|
||||
},
|
||||
{
|
||||
"typehint": "{\"type\":\"simple\",\"value\":\"string\",\"length\":1}",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"typehint": "?(error: ?Error) => void",
|
||||
"name": "callback"
|
||||
}
|
||||
],
|
||||
"tparams": null,
|
||||
"returntypehint": "void",
|
||||
"name": "mergeItem"
|
||||
},
|
||||
{
|
||||
"line": 86,
|
||||
"source": "clear: function(callback: ?(error: ?Error) => void) {\n RKAsyncStorage.clear(function(error) {\n callback && callback(convertError(error));\n });\n }",
|
||||
"docblock": "/**\n * Erases *all* AsyncStorage for all clients, libraries, etc. You probably\n * don't want to call this - use removeItem or multiRemove to clear only your\n * own keys instead.\n */\n",
|
||||
"modifiers": [
|
||||
"static"
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"typehint": "?(error: ?Error) => void",
|
||||
"name": "callback"
|
||||
}
|
||||
],
|
||||
"tparams": null,
|
||||
"returntypehint": null,
|
||||
"name": "clear"
|
||||
},
|
||||
{
|
||||
"line": 95,
|
||||
"source": "getAllKeys: function(callback: (error: ?Error) => void) {\n RKAsyncStorage.getAllKeys(function(error, keys) {\n callback(convertError(error), keys);\n });\n }",
|
||||
"docblock": "/**\n * Gets *all* keys known to the system, for all callers, libraries, etc.\n */\n",
|
||||
"modifiers": [
|
||||
"static"
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"typehint": "(error: ?Error) => void",
|
||||
"name": "callback"
|
||||
}
|
||||
],
|
||||
"tparams": null,
|
||||
"returntypehint": null,
|
||||
"name": "getAllKeys"
|
||||
},
|
||||
{
|
||||
"line": 117,
|
||||
"source": "multiGet: function(\n keys: Array<string>,\n callback: (errors: ?Array<Error>, result: ?Array<Array<string>>) => void\n ): void {\n RKAsyncStorage.multiGet(keys, function(errors, result) {\n callback(\n (errors && errors.map((error) => convertError(error))) || null,\n result\n );\n });\n }",
|
||||
"docblock": "/**\n * multiGet invokes callback with an array of key-value pair arrays that\n * matches the input format of multiSet.\n *\n * multiGet(['k1', 'k2'], cb) -> cb([['k1', 'val1'], ['k2', 'val2']])\n */\n",
|
||||
"modifiers": [
|
||||
"static"
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"typehint": "{\"type\":\"generic\",\"value\":[{\"type\":\"simple\",\"value\":\"Array\",\"length\":1},{\"type\":\"simple\",\"value\":\"string\",\"length\":1}],\"length\":4}",
|
||||
"name": "keys"
|
||||
},
|
||||
{
|
||||
"typehint": "(errors: ?Array<Error>, result: ?Array<Array<string>>) => void",
|
||||
"name": "callback"
|
||||
}
|
||||
],
|
||||
"tparams": null,
|
||||
"returntypehint": "void",
|
||||
"name": "multiGet"
|
||||
},
|
||||
{
|
||||
"line": 135,
|
||||
"source": "multiSet: function(\n keyValuePairs: Array<Array<string>>,\n callback: ?(errors: ?Array<Error>) => void\n ): void {\n RKAsyncStorage.multiSet(keyValuePairs, function(errors) {\n callback && callback(\n (errors && errors.map((error) => convertError(error))) || null\n );\n });\n }",
|
||||
"docblock": "/**\n * multiSet and multiMerge take arrays of key-value array pairs that match\n * the output of multiGet, e.g.\n *\n * multiSet([['k1', 'val1'], ['k2', 'val2']], cb);\n */\n",
|
||||
"modifiers": [
|
||||
"static"
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"typehint": "{\"type\":\"generic\",\"value\":[{\"type\":\"simple\",\"value\":\"Array\",\"length\":1},{\"type\":\"generic\",\"value\":[{\"type\":\"simple\",\"value\":\"Array\",\"length\":1},{\"type\":\"simple\",\"value\":\"string\",\"length\":1}],\"length\":4}],\"length\":7}",
|
||||
"name": "keyValuePairs"
|
||||
},
|
||||
{
|
||||
"typehint": "?(errors: ?Array<Error>) => void",
|
||||
"name": "callback"
|
||||
}
|
||||
],
|
||||
"tparams": null,
|
||||
"returntypehint": "void",
|
||||
"name": "multiSet"
|
||||
},
|
||||
{
|
||||
"line": 149,
|
||||
"source": "multiRemove: function(\n keys: Array<string>,\n callback: ?(errors: ?Array<Error>) => void\n ): void {\n RKAsyncStorage.multiRemove(keys, function(errors) {\n callback && callback(\n (errors && errors.map((error) => convertError(error))) || null\n );\n });\n }",
|
||||
"docblock": "/**\n * Delete all the keys in the `keys` array.\n */\n",
|
||||
"modifiers": [
|
||||
"static"
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"typehint": "{\"type\":\"generic\",\"value\":[{\"type\":\"simple\",\"value\":\"Array\",\"length\":1},{\"type\":\"simple\",\"value\":\"string\",\"length\":1}],\"length\":4}",
|
||||
"name": "keys"
|
||||
},
|
||||
{
|
||||
"typehint": "?(errors: ?Array<Error>) => void",
|
||||
"name": "callback"
|
||||
}
|
||||
],
|
||||
"tparams": null,
|
||||
"returntypehint": "void",
|
||||
"name": "multiRemove"
|
||||
},
|
||||
{
|
||||
"line": 166,
|
||||
"source": "multiMerge: function(\n keyValuePairs: Array<Array<string>>,\n callback: ?(errors: ?Array<Error>) => void\n ): void {\n RKAsyncStorage.multiMerge(keyValuePairs, function(errors) {\n callback && callback(\n (errors && errors.map((error) => convertError(error))) || null\n );\n });\n }",
|
||||
"docblock": "/**\n * Merges existing values with input values, assuming they are stringified\n * json.\n *\n * Not supported by all native implementations.\n */\n",
|
||||
"modifiers": [
|
||||
"static"
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"typehint": "{\"type\":\"generic\",\"value\":[{\"type\":\"simple\",\"value\":\"Array\",\"length\":1},{\"type\":\"generic\",\"value\":[{\"type\":\"simple\",\"value\":\"Array\",\"length\":1},{\"type\":\"simple\",\"value\":\"string\",\"length\":1}],\"length\":4}],\"length\":7}",
|
||||
"name": "keyValuePairs"
|
||||
},
|
||||
{
|
||||
"typehint": "?(errors: ?Array<Error>) => void",
|
||||
"name": "callback"
|
||||
}
|
||||
],
|
||||
"tparams": null,
|
||||
"returntypehint": "void",
|
||||
"name": "multiMerge"
|
||||
}
|
||||
],
|
||||
"properties": [],
|
||||
"superClass": null,
|
||||
"type": "api",
|
||||
"line": 27,
|
||||
"name": "AsyncStorage",
|
||||
"docblock": "/**\n * AsyncStorage is a simple, asynchronous, persistent, global, key-value storage\n * system. It should be used instead of LocalStorage.\n *\n * It is recommended that you use an abstraction on top of AsyncStorage instead\n * of AsyncStorage directly for anything more than light usage since it\n * operates globally.\n *\n * This JS code is a simple facad over the native iOS implementation to provide\n * a clear JS API, real Error objects, and simple non-multi functions.\n */\n",
|
||||
"requires": [
|
||||
{
|
||||
"name": "NativeModulesDeprecated"
|
||||
}
|
||||
]
|
||||
}</pre></div><noscript></noscript><div class="docs-prevnext"><a class="docs-next" href="cameraroll.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>
|
||||
own keys instead.</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) => void</span>) <a class="hash-link" href="#getallkeys">#</a></h4><div><p>Gets <em>all</em> keys known to the system, for all callers, libraries, etc.</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.</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, e.g.</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.</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.</p><p>Not supported by all native implementations.</p></div></div></div></div><noscript></noscript><div class="docs-prevnext"><a class="docs-next" href="cameraroll.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),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
|
||||
+2
-76
File diff suppressed because one or more lines are too long
+20
-11
File diff suppressed because one or more lines are too long
@@ -3,7 +3,7 @@ based on a set truncLength.</p><p>In the following example, the text will trunca
|
||||
to show only the first 17 characters plus '...' with a See More button to
|
||||
expand the text to its full length.</p><div class="prism language-javascript">render<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">return</span> <ExpandingText truncLength<span class="token operator">=</span><span class="token punctuation">{</span><span class="token number">20</span><span class="token punctuation">}</span> text<span class="token operator">=</span><span class="token punctuation">{</span>EXAMPLE_TEXT<span class="token punctuation">}</span> <span class="token operator">/</span><span class="token operator">></span><span class="token punctuation">;</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">,</span></div></div><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="seemorestyle"></a>seeMoreStyle <span class="propType">Text.propTypes.style</span> <a class="hash-link" href="#seemorestyle">#</a></h4><div><p>The styles that will be applied to the See More button. Default
|
||||
<span class="token punctuation">}</span><span class="token punctuation">,</span></div></div><h3><a class="anchor" name="props"></a>Props <a class="hash-link" href="#props">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="seemorestyle"></a>seeMoreStyle <span class="propType">Text.propTypes.style</span> <a class="hash-link" href="#seemorestyle">#</a></h4><div><p>The styles that will be applied to the See More button. Default
|
||||
is bold.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="seemoretext"></a>seeMoreText <span class="propType">string</span> <a class="hash-link" href="#seemoretext">#</a></h4><div><p>The caption that will be appended at the end, by default it is
|
||||
<code>'See More'</code>.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="text"></a>text <span class="propType">string</span> <a class="hash-link" href="#text">#</a></h4><div><p>Text to be displayed. It will be truncated if the character length
|
||||
is greater than the <code>truncLength</code> property.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="textstyle"></a>textStyle <span class="propType">Text.propTypes.style</span> <a class="hash-link" href="#textstyle">#</a></h4><div><p>The styles that will be applied to the text (both truncated and
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ images from local disk, such as the camera roll.</p><p>Example usage:</p><div cl
|
||||
<span class="token operator">/</span><span class="token operator">></span>
|
||||
<<span class="token operator">/</span>View<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></div><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="accessibilitylabel"></a>accessibilityLabel <span class="propType">string</span> <a class="hash-link" href="#accessibilitylabel">#</a></h4><div><p>accessibilityLabel - Custom string to display for accessibility.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="accessible"></a>accessible <span class="propType">bool</span> <a class="hash-link" href="#accessible">#</a></h4><div><p>accessible - Whether this element should be revealed as an accessible
|
||||
<span class="token punctuation">}</span><span class="token punctuation">,</span></div></div><h3><a class="anchor" name="props"></a>Props <a class="hash-link" href="#props">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="accessibilitylabel"></a>accessibilityLabel <span class="propType">string</span> <a class="hash-link" href="#accessibilitylabel">#</a></h4><div><p>accessibilityLabel - Custom string to display for accessibility.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="accessible"></a>accessible <span class="propType">bool</span> <a class="hash-link" href="#accessible">#</a></h4><div><p>accessible - Whether this element should be revealed as an accessible
|
||||
element.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="capinsets"></a>capInsets <span class="propType">EdgeInsetsPropType</span> <a class="hash-link" href="#capinsets">#</a></h4><div><p>capInsets - When the image is resized, the corners of the size specified
|
||||
by capInsets will stay a fixed size, but the center content and borders
|
||||
of the image will be stretched. This is useful for creating resizable
|
||||
|
||||
+1
-103
File diff suppressed because one or more lines are too long
+1
-1
@@ -28,7 +28,7 @@ data source tells the ListView if it needs to re-render a row because the
|
||||
source data has changed - see ListViewDataSource for more details.</p></li><li><p>Rate-limited row rendering - By default, only one row is rendered per
|
||||
event-loop (customizable with the <code>pageSize</code> prop). This breaks up the
|
||||
work into smaller chunks to reduce the chance of dropping frames while
|
||||
rendering rows.</p></li></ul></div><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="scrollview"></a><a href="scrollview.html#proptypes">ScrollView props...</a> <a class="hash-link" href="#scrollview">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="datasource"></a>dataSource <span class="propType">ListViewDataSource</span> <a class="hash-link" href="#datasource">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="initiallistsize"></a>initialListSize <span class="propType">number</span> <a class="hash-link" href="#initiallistsize">#</a></h4><div><p>How many rows to render on initial component mount. Use this to make
|
||||
rendering rows.</p></li></ul></div><h3><a class="anchor" name="props"></a>Props <a class="hash-link" href="#props">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="scrollview"></a><a href="scrollview.html#proptypes">ScrollView props...</a> <a class="hash-link" href="#scrollview">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="datasource"></a>dataSource <span class="propType">ListViewDataSource</span> <a class="hash-link" href="#datasource">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="initiallistsize"></a>initialListSize <span class="propType">number</span> <a class="hash-link" href="#initiallistsize">#</a></h4><div><p>How many rows to render on initial component mount. Use this to make
|
||||
it so that the first screen worth of data apears at one time instead of
|
||||
over the course of multiple frames.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onchangevisiblerows"></a>onChangeVisibleRows <span class="propType">func</span> <a class="hash-link" href="#onchangevisiblerows">#</a></h4><div><p>(visibleRows, changedRows) => void</p><p>Called when the set of visible rows changes. <code>visibleRows</code> maps
|
||||
{ sectionID: { rowID: true }} for all the visible rows, and
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -33,7 +33,7 @@ transitions back to it</li><li><code>resetTo(route)</code> - Replaces the top it
|
||||
initialRoute<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><span class="token punctuation">}</span>
|
||||
<span class="token operator">/</span><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><span class="token punctuation">;</span></div></div><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="initialroute"></a>initialRoute <span class="propType">{component: func, title: string, passProps: object, backButtonTitle: string, rightButtonTitle: string, onRightButtonPress: func, wrapperStyle: View.propTypes.style}</span> <a class="hash-link" href="#initialroute">#</a></h4><div><p>NavigatorIOS uses "route" objects to identify child views, their props,
|
||||
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span></div></div><h3><a class="anchor" name="props"></a>Props <a class="hash-link" href="#props">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="initialroute"></a>initialRoute <span class="propType">{component: func, title: string, passProps: object, backButtonTitle: string, rightButtonTitle: string, onRightButtonPress: func, wrapperStyle: View.propTypes.style}</span> <a class="hash-link" href="#initialroute">#</a></h4><div><p>NavigatorIOS uses "route" objects to identify child views, their props,
|
||||
and navigation bar configuration. "push" and all the other navigation
|
||||
operations expect routes to be like this:</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="itemwrapperstyle"></a>itemWrapperStyle <span class="propType">View.propTypes.style</span> <a class="hash-link" href="#itemwrapperstyle">#</a></h4><div><p>The default wrapper style for components in the navigator.
|
||||
A common use case is to set the backgroundColor for every page</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="tintcolor"></a>tintColor <span class="propType">string</span> <a class="hash-link" href="#tintcolor">#</a></h4><div><p>The color used for buttons in the navigation bar</p></div></div></div></div><noscript></noscript><div class="docs-prevnext"><a class="docs-next" href="pickerios.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>
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-35
@@ -10,41 +10,7 @@ by the pixel ratio.</p><p>var image = getImage({
|
||||
width: 200 <em> PixelRatio.get(),
|
||||
height: 100 </em> PixelRatio.get()
|
||||
});</p><Image source={image} style={{width: 200, height: 100}} />
|
||||
</div><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="get"></a><span class="propType">static </span>get(<span class="propType"></span>) <a class="hash-link" href="#get">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="startdetecting"></a><span class="propType">static </span>startDetecting(<span class="propType"></span>) <a class="hash-link" href="#startdetecting">#</a></h4></div></div><pre>{
|
||||
"methods": [
|
||||
{
|
||||
"line": 45,
|
||||
"source": "static get() {\n return Dimensions.get('window').scale;\n }",
|
||||
"modifiers": [
|
||||
"static"
|
||||
],
|
||||
"params": [],
|
||||
"tparams": null,
|
||||
"returntypehint": null,
|
||||
"name": "get"
|
||||
},
|
||||
{
|
||||
"line": 49,
|
||||
"source": "static startDetecting() {\n // no-op for iOS, but this is useful for other platforms\n }",
|
||||
"modifiers": [
|
||||
"static"
|
||||
],
|
||||
"params": [],
|
||||
"tparams": null,
|
||||
"returntypehint": null,
|
||||
"name": "startDetecting"
|
||||
}
|
||||
],
|
||||
"type": "api",
|
||||
"line": 44,
|
||||
"name": "PixelRatio",
|
||||
"docblock": "/**\n * PixelRatio class gives access to the device pixel density.\n *\n * Some examples:\n * - PixelRatio.get() === 2\n * - iPhone 4, 4S\n * - iPhone 5, 5c, 5s\n * - iPhone 6\n *\n * - PixelRatio.get() === 3\n * - iPhone 6 plus\n *\n * There are a few use cases for using PixelRatio:\n *\n * == Displaying a line that's as thin as the device permits\n *\n * A width of 1 is actually pretty thick on an iPhone 4+, we can do one that's\n * thinner using a width of 1 / PixelRatio.get(). It's a technique that works\n * on all the devices independent of their pixel density.\n *\n * style={{ borderWidth: 1 / PixelRatio.get() }}\n *\n * == Fetching a correctly sized image\n *\n * You should get a higher resolution image if you are on a high pixel density\n * device. A good rule of thumb is to multiply the size of the image you display\n * by the pixel ratio.\n *\n * var image = getImage({\n * width: 200 * PixelRatio.get(),\n * height: 100 * PixelRatio.get()\n * });\n * <Image source={image} style={{width: 200, height: 100}} />\n */\n",
|
||||
"requires": [
|
||||
{
|
||||
"name": "Dimensions"
|
||||
}
|
||||
]
|
||||
}</pre></div><noscript></noscript><div class="docs-prevnext"><a class="docs-next" href="statusbarios.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>
|
||||
</div><h3><a class="anchor" name="methods"></a>Methods <a class="hash-link" href="#methods">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="get"></a><span class="propType">static </span>get(<span class="propType"></span>) <a class="hash-link" href="#get">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="startdetecting"></a><span class="propType">static </span>startDetecting(<span class="propType"></span>) <a class="hash-link" href="#startdetecting">#</a></h4></div></div></div><noscript></noscript><div class="docs-prevnext"><a class="docs-next" href="statusbarios.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),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-76
File diff suppressed because one or more lines are too long
+1
-104
@@ -23,110 +23,7 @@ in the render function.</p><p>Performance:
|
||||
- Making a stylesheet from a style object makes it possible to refer to it
|
||||
by ID instead of creating a new style object every time.
|
||||
- It also allows to send the style only once through the bridge. All
|
||||
subsequent uses are going to refer an id (not implemented yet).</p></div><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="create"></a><span class="propType">static </span>create(<span class="propType">obj</span>) <a class="hash-link" href="#create">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="validatestyleprop"></a><span class="propType">static </span>validateStyleProp(<span class="propType">prop, style, caller</span>) <a class="hash-link" href="#validatestyleprop">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="validatestyle"></a><span class="propType">static </span>validateStyle(<span class="propType">name, styles</span>) <a class="hash-link" href="#validatestyle">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="addvalidstyleproptypes"></a><span class="propType">static </span>addValidStylePropTypes(<span class="propType">stylePropTypes</span>) <a class="hash-link" href="#addvalidstyleproptypes">#</a></h4></div></div><pre>{
|
||||
"methods": [
|
||||
{
|
||||
"line": 55,
|
||||
"source": "static create(obj) {\n var result = {};\n for (var key in obj) {\n StyleSheet.validateStyle(key, obj);\n result[key] = StyleSheetRegistry.registerStyle(obj[key]);\n }\n return result;\n }",
|
||||
"modifiers": [
|
||||
"static"
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"typehint": null,
|
||||
"name": "obj"
|
||||
}
|
||||
],
|
||||
"tparams": null,
|
||||
"returntypehint": null,
|
||||
"name": "create"
|
||||
},
|
||||
{
|
||||
"line": 64,
|
||||
"source": "static validateStyleProp(prop, style, caller) {\n if (!__DEV__) {\n return;\n }\n if (allStylePropTypes[prop] === undefined) {\n var message1 = '\"' + prop + '\" is not a valid style property.';\n var message2 = '\\nValid style props: ' +\n JSON.stringify(Object.keys(allStylePropTypes), null, ' ');\n styleError(message1, style, caller, message2);\n }\n var error = allStylePropTypes[prop](\n style,\n prop,\n caller,\n ReactPropTypeLocations.prop\n );\n if (error) {\n styleError(error.message, style, caller);\n }\n }",
|
||||
"modifiers": [
|
||||
"static"
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"typehint": null,
|
||||
"name": "prop"
|
||||
},
|
||||
{
|
||||
"typehint": null,
|
||||
"name": "style"
|
||||
},
|
||||
{
|
||||
"typehint": null,
|
||||
"name": "caller"
|
||||
}
|
||||
],
|
||||
"tparams": null,
|
||||
"returntypehint": null,
|
||||
"name": "validateStyleProp"
|
||||
},
|
||||
{
|
||||
"line": 85,
|
||||
"source": "static validateStyle(name, styles) {\n if (!__DEV__) {\n return;\n }\n for (var prop in styles[name]) {\n StyleSheet.validateStyleProp(prop, styles[name], 'StyleSheet ' + name);\n }\n }",
|
||||
"modifiers": [
|
||||
"static"
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"typehint": null,
|
||||
"name": "name"
|
||||
},
|
||||
{
|
||||
"typehint": null,
|
||||
"name": "styles"
|
||||
}
|
||||
],
|
||||
"tparams": null,
|
||||
"returntypehint": null,
|
||||
"name": "validateStyle"
|
||||
},
|
||||
{
|
||||
"line": 94,
|
||||
"source": "static addValidStylePropTypes(stylePropTypes) {\n for (var key in stylePropTypes) {\n invariant(\n allStylePropTypes[key] === undefined ||\n allStylePropTypes[key] === stylePropTypes[key],\n 'Attemped to redefine existing style prop type \"' + key + '\".'\n );\n allStylePropTypes[key] = stylePropTypes[key];\n }\n }",
|
||||
"modifiers": [
|
||||
"static"
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"typehint": null,
|
||||
"name": "stylePropTypes"
|
||||
}
|
||||
],
|
||||
"tparams": null,
|
||||
"returntypehint": null,
|
||||
"name": "addValidStylePropTypes"
|
||||
}
|
||||
],
|
||||
"type": "api",
|
||||
"line": 54,
|
||||
"name": "StyleSheet",
|
||||
"docblock": "/**\n * A StyleSheet is an abstraction similar to CSS StyleSheets\n *\n * Create a new StyleSheet:\n *\n * var styles = StyleSheet.create({\n * container: {\n * borderRadius: 4,\n * borderWidth: 0.5,\n * borderColor: '#d6d7da',\n * },\n * title: {\n * fontSize: 19,\n * fontWeight: 'bold',\n * },\n * activeTitle: {\n * color: 'red',\n * },\n * })\n *\n * Use a StyleSheet:\n *\n * <View style={styles.container}>\n * <Text style={[styles.title, this.props.isActive && styles.activeTitle]} />\n * </View>\n *\n * Code quality:\n * - By moving styles away from the render function, you're making the code\n * code easier to understand.\n * - Naming the styles is a good way to add meaning to the low level components\n * in the render function.\n *\n * Performance:\n * - Making a stylesheet from a style object makes it possible to refer to it\n * by ID instead of creating a new style object every time.\n * - It also allows to send the style only once through the bridge. All\n * subsequent uses are going to refer an id (not implemented yet).\n */\n",
|
||||
"requires": [
|
||||
{
|
||||
"name": "ImageStylePropTypes"
|
||||
},
|
||||
{
|
||||
"name": "ReactPropTypeLocations"
|
||||
},
|
||||
{
|
||||
"name": "StyleSheetRegistry"
|
||||
},
|
||||
{
|
||||
"name": "TextStylePropTypes"
|
||||
},
|
||||
{
|
||||
"name": "ViewStylePropTypes"
|
||||
},
|
||||
{
|
||||
"name": "invariant"
|
||||
}
|
||||
]
|
||||
}</pre></div><noscript></noscript><div class="docs-prevnext"></div></div></section><footer class="wrap"><div class="right">© 2015 Facebook Inc.</div></footer></div><div id="fb-root"></div><script>
|
||||
subsequent uses are going to refer an id (not implemented yet).</p></div><h3><a class="anchor" name="methods"></a>Methods <a class="hash-link" href="#methods">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="create"></a><span class="propType">static </span>create(<span class="propType">obj</span>) <a class="hash-link" href="#create">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="validatestyleprop"></a><span class="propType">static </span>validateStyleProp(<span class="propType">prop, style, caller</span>) <a class="hash-link" href="#validatestyleprop">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="validatestyle"></a><span class="propType">static </span>validateStyle(<span class="propType">name, styles</span>) <a class="hash-link" href="#validatestyle">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="addvalidstyleproptypes"></a><span class="propType">static </span>addValidStylePropTypes(<span class="propType">stylePropTypes</span>) <a class="hash-link" href="#addvalidstyleproptypes">#</a></h4></div></div></div><noscript></noscript><div class="docs-prevnext"></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),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
a controlled component, so you must hook in to the <code>onValueChange</code> callback
|
||||
and update the <code>value</code> prop in order for the component to update, otherwise
|
||||
the user's change will be reverted immediately to reflect <code>props.value</code> as the
|
||||
source of truth.</p></div><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="disabled"></a>disabled <span class="propType">bool</span> <a class="hash-link" href="#disabled">#</a></h4><div><p>If true the user won't be able to toggle the switch.
|
||||
source of truth.</p></div><h3><a class="anchor" name="props"></a>Props <a class="hash-link" href="#props">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="disabled"></a>disabled <span class="propType">bool</span> <a class="hash-link" href="#disabled">#</a></h4><div><p>If true the user won't be able to toggle the switch.
|
||||
Default value is false.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="ontintcolor"></a>onTintColor <span class="propType">string</span> <a class="hash-link" href="#ontintcolor">#</a></h4><div><p>Background color when the switch is turned on.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onvaluechange"></a>onValueChange <span class="propType">func</span> <a class="hash-link" href="#onvaluechange">#</a></h4><div><p>Callback that is called when the user toggles the switch.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="thumbtintcolor"></a>thumbTintColor <span class="propType">string</span> <a class="hash-link" href="#thumbtintcolor">#</a></h4><div><p>Background color for the switch round button.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="tintcolor"></a>tintColor <span class="propType">string</span> <a class="hash-link" href="#tintcolor">#</a></h4><div><p>Background color when the switch is turned off.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="value"></a>value <span class="propType">bool</span> <a class="hash-link" href="#value">#</a></h4><div><p>The value of the switch, if true the switch will be turned on.
|
||||
Default value is false.</p></div></div></div></div><noscript></noscript><div class="docs-prevnext"><a class="docs-next" href="tabbarios.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(){
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -23,7 +23,7 @@ each other on account of the literal newlines:</p><div class="prism language-jav
|
||||
fontSize<span class="token punctuation">:</span> <span class="token number">20</span><span class="token punctuation">,</span>
|
||||
fontWeight<span class="token punctuation">:</span> <span class="token string">'bold'</span><span class="token punctuation">,</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">;</span></div></div><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="numberoflines"></a>numberOfLines <span class="propType">number</span> <a class="hash-link" href="#numberoflines">#</a></h4><div><p>Used to truncate the text with an elipsis after computing the text
|
||||
<span class="token punctuation">}</span><span class="token punctuation">;</span></div></div><h3><a class="anchor" name="props"></a>Props <a class="hash-link" href="#props">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="numberoflines"></a>numberOfLines <span class="propType">number</span> <a class="hash-link" href="#numberoflines">#</a></h4><div><p>Used to truncate the text with an elipsis after computing the text
|
||||
layout, including line wrapping, such that the total number of lines does
|
||||
not exceed this number.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onpress"></a>onPress <span class="propType">func</span> <a class="hash-link" href="#onpress">#</a></h4><div><p>This function is called on press. Text intrinsically supports press
|
||||
handling with a default highlight state (which can be disabled with
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ Setting <code>value</code> once is like setting the default value, but you can c
|
||||
continuously based on <code>onChangeText</code> events as well. If you really want to
|
||||
force the component to always revert to the value you are setting, you can
|
||||
set <code>controlled={true}</code>.</p><p>The <code>multiline</code> prop is not supported in all releases, and some props are
|
||||
multiline only.</p></div><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="autocapitalize"></a>autoCapitalize <span class="propType">enum('none', 'sentences', 'words', 'characters')</span> <a class="hash-link" href="#autocapitalize">#</a></h4><div><p>Can tell TextInput to automatically capitalize certain characters.</p><ul><li>characters: all characters,</li><li>words: first letter of each word</li><li>sentences: first letter of each sentence (default)</li><li>none: don't auto capitalize anything</li></ul></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="autocorrect"></a>autoCorrect <span class="propType">bool</span> <a class="hash-link" href="#autocorrect">#</a></h4><div><p>If false, disables auto-correct. Default value is true.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="autofocus"></a>autoFocus <span class="propType">bool</span> <a class="hash-link" href="#autofocus">#</a></h4><div><p>If true, focuses the input on componentDidMount. Default value is false.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="bufferdelay"></a>bufferDelay <span class="propType">number</span> <a class="hash-link" href="#bufferdelay">#</a></h4><div><p>This helps avoid drops characters due to race conditions between JS and
|
||||
multiline only.</p></div><h3><a class="anchor" name="props"></a>Props <a class="hash-link" href="#props">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="autocapitalize"></a>autoCapitalize <span class="propType">enum('none', 'sentences', 'words', 'characters')</span> <a class="hash-link" href="#autocapitalize">#</a></h4><div><p>Can tell TextInput to automatically capitalize certain characters.</p><ul><li>characters: all characters,</li><li>words: first letter of each word</li><li>sentences: first letter of each sentence (default)</li><li>none: don't auto capitalize anything</li></ul></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="autocorrect"></a>autoCorrect <span class="propType">bool</span> <a class="hash-link" href="#autocorrect">#</a></h4><div><p>If false, disables auto-correct. Default value is true.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="autofocus"></a>autoFocus <span class="propType">bool</span> <a class="hash-link" href="#autofocus">#</a></h4><div><p>If true, focuses the input on componentDidMount. Default value is false.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="bufferdelay"></a>bufferDelay <span class="propType">number</span> <a class="hash-link" href="#bufferdelay">#</a></h4><div><p>This helps avoid drops characters due to race conditions between JS and
|
||||
the native text input. The default should be fine, but if you're
|
||||
potentially doing very slow operations on every keystroke then you may
|
||||
want to try increasing this.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="clearbuttonmode"></a>clearButtonMode <span class="propType">enum('never', 'while-editing', 'unless-editing', 'always')</span> <a class="hash-link" href="#clearbuttonmode">#</a></h4><div><p>When the clear button should appear on the right side of the text view</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="controlled"></a>controlled <span class="propType">bool</span> <a class="hash-link" href="#controlled">#</a></h4><div><p>If you really want this to behave as a controlled component, you can set
|
||||
|
||||
@@ -12,7 +12,7 @@ backgroundColor of the wrapped view isn't explicitly set to an opaque color
|
||||
<span class="token operator">/</span><span class="token operator">></span>
|
||||
<<span class="token operator">/</span>View<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></div><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>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 class="prop"><h4 class="propTitle"><a class="anchor" name="onpress"></a>onPress <span class="propType">func</span> <a class="hash-link" href="#onpress">#</a></h4><div><p>Called when the touch is released, but not if cancelled (e.g. by
|
||||
a scroll that steals the responder lock).</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="style"></a>style <span class="propType">View.propTypes.style</span> <a class="hash-link" href="#style">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="underlaycolor"></a>underlayColor <span class="propType">string</span> <a class="hash-link" href="#underlaycolor">#</a></h4><div><p>The color of the underlay that will show through when the touch is
|
||||
active.</p></div></div></div></div><noscript></noscript><div class="docs-prevnext"><a class="docs-next" href="touchableopacity.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>
|
||||
|
||||
@@ -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>View<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></div><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>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><noscript></noscript><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),
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1
-1
@@ -15,7 +15,7 @@ a default parent (flexDirection: 'column'), the children will fill the
|
||||
but not the height.</p><p>Many library components can be treated like plain <code>Views</code> in many cases, for
|
||||
example passing them children, setting style, etc.</p><p><code>View</code>s are designed to be used with <code>StyleSheet</code>s for clarity and
|
||||
performance, although inline styles are also supported. It is common for
|
||||
<code>StyleSheet</code>s to be combined dynamically. See <code>StyleSheet.js</code> for more info.</p></div><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="accessible"></a>accessible <span class="propType">bool</span> <a class="hash-link" href="#accessible">#</a></h4><div><p>When true, indicates that the view is an accessibility element</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onmoveshouldsetresponder"></a>onMoveShouldSetResponder <span class="propType">func</span> <a class="hash-link" href="#onmoveshouldsetresponder">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onrespondergrant"></a>onResponderGrant <span class="propType">func</span> <a class="hash-link" href="#onrespondergrant">#</a></h4><div><p>For most touch interactions, you'll simply want to wrap your component in
|
||||
<code>StyleSheet</code>s to be combined dynamically. See <code>StyleSheet.js</code> for more info.</p></div><h3><a class="anchor" name="props"></a>Props <a class="hash-link" href="#props">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="accessible"></a>accessible <span class="propType">bool</span> <a class="hash-link" href="#accessible">#</a></h4><div><p>When true, indicates that the view is an accessibility element</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onmoveshouldsetresponder"></a>onMoveShouldSetResponder <span class="propType">func</span> <a class="hash-link" href="#onmoveshouldsetresponder">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onrespondergrant"></a>onResponderGrant <span class="propType">func</span> <a class="hash-link" href="#onrespondergrant">#</a></h4><div><p>For most touch interactions, you'll simply want to wrap your component in
|
||||
<code>TouchableHighlight.js</code>. Check out <code>Touchable.js</code> and
|
||||
<code>ScrollResponder.js</code> for more discussion.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onrespondermove"></a>onResponderMove <span class="propType">func</span> <a class="hash-link" href="#onrespondermove">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onresponderreject"></a>onResponderReject <span class="propType">func</span> <a class="hash-link" href="#onresponderreject">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onresponderrelease"></a>onResponderRelease <span class="propType">func</span> <a class="hash-link" href="#onresponderrelease">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onresponderterminate"></a>onResponderTerminate <span class="propType">func</span> <a class="hash-link" href="#onresponderterminate">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onresponderterminationrequest"></a>onResponderTerminationRequest <span class="propType">func</span> <a class="hash-link" href="#onresponderterminationrequest">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onstartshouldsetresponder"></a>onStartShouldSetResponder <span class="propType">func</span> <a class="hash-link" href="#onstartshouldsetresponder">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onstartshouldsetrespondercapture"></a>onStartShouldSetResponderCapture <span class="propType">func</span> <a class="hash-link" href="#onstartshouldsetrespondercapture">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="pointerevents"></a>pointerEvents <span class="propType">enum('box-none', 'none', 'box-only', 'auto')</span> <a class="hash-link" href="#pointerevents">#</a></h4><div><p>In the absence of <code>auto</code> property, <code>none</code> is much like <code>CSS</code>'s <code>none</code>
|
||||
value. <code>box-none</code> is as if you had applied the <code>CSS</code> class:</p><p> .cantTouchThis * {
|
||||
|
||||
Reference in New Issue
Block a user