Prettier the rest of ReactNative

Reviewed By: yungsters

Differential Revision: D7974340

fbshipit-source-id: 5fe457a8a9be4bd360fc3af9acb5c1136b2be0d7
This commit is contained in:
Eli White
2018-05-11 13:32:37 -07:00
committed by Facebook Github Bot
parent aba4ec0c09
commit 36fcbaa56d
170 changed files with 5132 additions and 3995 deletions
@@ -4,6 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
'use strict';
@@ -25,13 +26,14 @@ class TokenizedTextExample extends React.Component {
this.state = {text: ''};
}
render() {
//define delimiter
let delimiter = /\s+/;
//split string
let _text = this.state.text;
let token, index, parts = [];
let token,
index,
parts = [];
while (_text) {
delimiter.lastIndex = 0;
token = delimiter.exec(_text);
@@ -50,9 +52,13 @@ class TokenizedTextExample extends React.Component {
parts.push(_text);
//highlight hashtags
parts = parts.map((text) => {
parts = parts.map(text => {
if (/^#/.test(text)) {
return <Text key={text} style={styles.hashtag}>{text}</Text>;
return (
<Text key={text} style={styles.hashtag}>
{text}
</Text>
);
} else {
return text;
}
@@ -65,7 +71,7 @@ class TokenizedTextExample extends React.Component {
testID="tokenizedInput"
multiline={true}
style={styles.multiline}
onChangeText={(text) => {
onChangeText={text => {
this.setState({text});
}}>
<Text>{parts}</Text>
@@ -80,7 +86,7 @@ class TextInputTestApp extends React.Component {
app = this;
}
handleOnSubmitEditing = (record) => {
handleOnSubmitEditing = record => {
Recording.record(record);
};
@@ -173,7 +179,7 @@ var TextInputTestModule = {
BatchedBridge.registerCallableModule(
'TextInputTestModule',
TextInputTestModule
TextInputTestModule,
);
module.exports = TextInputTestModule;