Diving Into The Basics - ganeshkhutwad/react-native-app GitHub Wiki
- View
- Text
- TextInput
- We can use inline styles. (not much good idea)
- For layouting and positioning elements, React Native uses Flexbox.
- By default every view uses flexbox in React Native.
- Flexbox uses to organize the elements.
- Inline styles are hard to understand and manage in the future.
- StyleSheet is a class provided by react-native to
const styles = StyleSheet.create({
screen: {}
});
- can add validation and performance wise better in future
- for wrong syntax throws an error.
onClickText event. onPress event.
Better way to update the state setCourseGoals(currentGoals => [...currentGoals, enteredGoal]);
than setCourseGoals([...currentGoals, enteredGoal]);
same as react
- has less styling support, so always wrap it inside for styling purpose.
- Just wrap content inside ScrollView component.
- ScrollView is a great when you have limited elements but if you have very long list then its not a good choice
- For such case, we should use component.
(
{itemData.item.value}
)}
>
- In React Native now also supports "id" instead of "key". Try "uid"
and there so many component like it with different uses.