https://2018.stateofjs.com/testing/overview/
By https://docs.fastlane.tools
Animated.timing(this.state.animatedValue, {
toValue: 1,
duration: 500,
useNativeDriver: true, // <-- Add this
}).start();
class MyComponent extends React.Component {
render() {
return this.props.data.map((item, i) => {
return <Text key={item.id}>{item.title}</Text>
});
}
}
Without a unique key for every list item, React will re-render every time you add/remove an item.
class MyComponent extends React.Component {
constructor(props) {
super(props);
this.something = this.something.bind(this);
}
something() {
// Execute function
}
render() {
return <Text onPress={this.something}>Execute something</Text>
}
}
render() {
return {
<Text onPress={()=>this.something()}>Execute something</Text>
<Text onPress={this.something.bind(this)}>Execute something</Text>
}
}