September 2018
Intermediate to advanced
302 pages
7h 17m
English
Before we proceed further, I want to show you the best practices when it comes to writing your JSX markup. This will make your journey through my further examples much easier.
Let's start with the simple rules:
// good<Button onPress={handlePress} />// bad<Button onPress={handlePress}></Button>
// badfunction HelloComponent(props) { if (isSomeCondition) {return <p>Hello!</p>; }return null;}// badconst HelloComponent = () => { return isSomeCondition ? <p>Hello!</p> : null };// ok (probably it will require some logic before return)const HelloComponent = () =>
Read now
Unlock full access