Skip to content

Instantly share code, notes, and snippets.

View dheerajmalik1's full-sized avatar
🎯
Focusing

Dheeraj Malik dheerajmalik1

🎯
Focusing
View GitHub Profile
@dheerajmalik1
dheerajmalik1 / The Rules.md
Created October 3, 2021 11:02 — forked from sebmarkbage/The Rules.md
The Rules of React

The Rules of React

All libraries have subtle rules that you have to follow for them to work well. Often these are implied and undocumented rules that you have to learn as you go. This is an attempt to document the rules of React renders. Ideally a type system could enforce it.

What Functions Are "Pure"?

A number of methods in React are assumed to be "pure".

On classes that's the constructor, getDerivedStateFromProps, shouldComponentUpdate and render.

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example