A small React behaviour that still catches engineers off guard.
If you write:
items.length && <List />
React may render 0 instead of nothing.
↓↓ Why? ↓↓
| GitHub | https://github.com/pH-7 |
| YouTube | https://youtube.com/@ph7programming |
| pH7 | https://ph7.me |
To prevent the React && rendering bugs before they ship, add a lint rule and let CI enforce it.
Such as below ⬇️
// eslint.config.js
rules: {
'react/jsx-no-leaked-render': ['error', {
validStrategies: ['coerce', 'ternary']
}]
}
Push → Lint → Block unsafe JSX → Merge.
A small React behaviour that still catches engineers off guard.
If you write:
items.length && <List />
React may render 0 instead of nothing.
↓↓ Why? ↓↓
Feature flags are one of those things that separate teams that ship confidently from those that cross their fingers on every release... and freeze deployments after 4 PM and on Fridays.
Here’s how we avoid that ↓ ↓ ↓
There's much more to life than just money.
Yet, so many people spend most of their time and energy chasing it, forgetting all the rest…
Health, Family, Curiosity, Freedom, …
What are you focusing on these days?
First, get focused 🧘
One single thing at a time. Ask yourself: what's my highest priority right now, the one thing I really want to accomplish?
Start from there ✨
🔄 Create → Reinvent → Iterate → Optimize... 🔄
Minimalist Life Tips 🍳
🥄 1 fork, 1 knife, 1 spoon → no clutter, no excuses.
🥢 Chopsticks → tiny, portable, easy to clean.
🍚 1 rice cooker → perfect for rice, pasta, soup, even hot chocolate.
Supermarkets are your storage. Buy only when you need it, not 'just in case'