Skip to main content
All Posts By

lejournaldux

Technologie

Use ternaries rather than && in JSX

What problems can happen when you use && to conditionally render content in JSXWhat's wrong with this code?1function ContactList({contacts}) {2 return (3 <div>4 <ul>5 {contacts.length &&6 contacts.map(contact => (7 <li…
lejournaldux
3 octobre 2020
Science

Why React Hooks over HOCs

In a modern React world, everyone uses function components with React Hooks. However, the concept of higher-order components (HOCs) is still applicable in a modern React world, because they can…
lejournaldux
3 octobre 2020