Skip to content

isnifer/tipsi-react-native-guideline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

tipsi-react-native-guideline

Tipsi Guideline for React-Native Development

Event handlers

Bad

<TextInput
  onChangeText={username => this.setState({ username })}
  onSubmitEditing={() => this.passwordInput.focus()}
/>

Good

<TextInput
  onChangeText={this.handleChangeUsername}
  onSubmitEditing={this.setPasswordInputActive}
/>

String attributes

Bad

<TextInput
  underlayColor={'#000000'}
/>

Good

<TextInput
  underlayColor="#000000"
/>

Reference Handler

Bad

<TextInput
  ref={node => this.passwordInput = node}
/>

Good

<TextInput
  ref={this.setPasswordInputRef}
/>

Style attribute

Bad

<TextInput
  style={[styles.signInButton]}
/>

Bad

<TextInput
  style={{ marginRight: 15, marginLeft: 16 }}
/>

Good

<TextInput
  style={styles.signInButton}
/>

Good

<TextInput
  style={[styles.signInButton, this.props.isActive && styles.signInButtonActive]}
/>

About

Tipsi Guideline for React-Native Development

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published