Simply React ⚛️

Why I love React Patterns so much

Kent C. Dodds
Utah
wife, 4 kids, & a dog
PayPal

Please Stand

If you are physically able ❤️ ♿️

What this talk is

  • Typical lifecycle of a component
    (not what you're thinking)
  • How patterns can simplify
  • Composability
  • A challenge

What this talk is not

Let's get started

Horses can sleep both lying down and standing up. Domestic horses have a lifespan of around 25 years. A 19th century horse named 'Old Billy' is said to have lived 62 years.
Rhino skin maybe thick but it can be quite sensitive to sunburns and insect bites which is why they like wallow so much – when the mud dries it acts as protection from the sunburns and insects.
If you’re looking to hunt a unicorn, but don’t know where to begin, try Lake Superior State University in Sault Ste. Marie, Michigan. Since 1971, the university has issued permits to unicorn questers.
Theme: Night Owl by Sarah Drasner
Font: Dank Mono by Phil Plückthun
Horses can sleep both lying down and standing up. Domestic horses have a lifespan of around 25 years. A 19th century horse named 'Old Billy' is said to have lived 62 years.
Rhino skin maybe thick but it can be quite sensitive to sunburns and insect bites which is why they like wallow so much – when the mud dries it acts as protection from the sunburns and insects.
If you’re looking to hunt a unicorn, but don’t know where to begin, try Lake Superior State University in Sault Ste. Marie, Michigan. Since 1971, the university has issued permits to unicorn questers.
Horses can sleep both lying down and standing up. Domestic horses have a lifespan of around 25 years. A 19th century horse named 'Old Billy' is said to have lived 62 years.
Rhino skin maybe thick but it can be quite sensitive to sunburns and insect bites which is why they like wallow so much – when the mud dries it acts as protection from the sunburns and insects.
If you’re looking to hunt a unicorn, but don’t know where to begin, try Lake Superior State University in Sault Ste. Marie, Michigan. Since 1971, the university has issued permits to unicorn questers.
Horses can sleep both lying down and standing up. Domestic horses have a lifespan of around 25 years. A 19th century horse named 'Old Billy' is said to have lived 62 years.
Rhino skin maybe thick but it can be quite sensitive to sunburns and insect bites which is why they like wallow so much – when the mud dries it acts as protection from the sunburns and insects.
If you’re looking to hunt a unicorn, but don’t know where to begin, try Lake Superior State University in Sault Ste. Marie, Michigan. Since 1971, the university has issued permits to unicorn questers.
Horses can sleep both lying down and standing up. Domestic horses have a lifespan of around 25 years. A 19th century horse named 'Old Billy' is said to have lived 62 years.
Rhino skin maybe thick but it can be quite sensitive to sunburns and insect bites which is why they like wallow so much – when the mud dries it acts as protection from the sunburns and insects.
If you’re looking to hunt a unicorn, but don’t know where to begin, try Lake Superior State University in Sault Ste. Marie, Michigan. Since 1971, the university has issued permits to unicorn questers.
Horses can sleep both lying down and standing up. Domestic horses have a lifespan of around 25 years. A 19th century horse named 'Old Billy' is said to have lived 62 years.
Rhino skin maybe thick but it can be quite sensitive to sunburns and insect bites which is why they like wallow so much – when the mud dries it acts as protection from the sunburns and insects.
If you’re looking to hunt a unicorn, but don’t know where to begin, try Lake Superior State University in Sault Ste. Marie, Michigan. Since 1971, the university has issued permits to unicorn questers.
Horses can sleep both lying down and standing up. Domestic horses have a lifespan of around 25 years. A 19th century horse named 'Old Billy' is said to have lived 62 years.
Rhino skin maybe thick but it can be quite sensitive to sunburns and insect bites which is why they like wallow so much – when the mud dries it acts as protection from the sunburns and insects.
If you’re looking to hunt a unicorn, but don’t know where to begin, try Lake Superior State University in Sault Ste. Marie, Michigan. Since 1971, the university has issued permits to unicorn questers.
Horses can sleep both lying down and standing up. Domestic horses have a lifespan of around 25 years. A 19th century horse named 'Old Billy' is said to have lived 62 years.
Rhino skin maybe thick but it can be quite sensitive to sunburns and insect bites which is why they like wallow so much – when the mud dries it acts as protection from the sunburns and insects.
If you’re looking to hunt a unicorn, but don’t know where to begin, try Lake Superior State University in Sault Ste. Marie, Michigan. Since 1971, the university has issued permits to unicorn questers.
Horses can sleep both lying down and standing up. Domestic horses have a lifespan of around 25 years. A 19th century horse named 'Old Billy' is said to have lived 62 years.
Rhino skin maybe thick but it can be quite sensitive to sunburns and insect bites which is why they like wallow so much – when the mud dries it acts as protection from the sunburns and insects.
If you’re looking to hunt a unicorn, but don’t know where to begin, try Lake Superior State University in Sault Ste. Marie, Michigan. Since 1971, the university has issued permits to unicorn questers.
bundle size/perf 😵
maintenance overhead 😖
implementation complexity 🐛
API complexity 😕

Demo

Codesandbox

Thank you Ives ❣️

Resources

Learn React 🆓kcd.im/beginner-react
Level up ⚛️kcd.im/advanced-react

A word of caution

What if this is all you will ever need?

Horses can sleep both lying down and standing up. Domestic horses have a lifespan of around 25 years. A 19th century horse named 'Old Billy' is said to have lived 62 years.
Rhino skin maybe thick but it can be quite sensitive to sunburns and insect bites which is why they like wallow so much – when the mud dries it acts as protection from the sunburns and insects.
If you’re looking to hunt a unicorn, but don’t know where to begin, try Lake Superior State University in Sault Ste. Marie, Michigan. Since 1971, the university has issued permits to unicorn questers.

YAGNI

You Ain't Gonna Need It
Optimize for deletability
LISTEN TO MICHAEL

Hot Garbage: Clean Code is Dead
https://youtu.be/-NP_upexPFg

Use patterns that simplify your API

state reducers
control props
providers
compound components
render props
Let's (re)discover more!