What is React?
Library
Ecosystem
Paradigm
ui = fn(state)
User Interfaces
Computer says, "Hello human, what can I do for you today?"
Human says, "Hello computer, can you please answer my emails for me?"
Computer: ...
UI !== UX
Imperative
To make scrambled eggs you must first get a bowl, next crack the eggs, if there are any shells in there then hope no one is looking and dig them out with your finger. Ok now whisk in the eggs with some milk, unless you're out of milk then use water or the tears from your sadness because you're still reading these instructions.
Human:
Declarative
I want to eat scrambled eggs.
Ok, I know how to make scrambled eggs.
Human:
Computer:
Some imperative (pseudo) code!
var eggs = fridge.select('eggs');
var bowlOfEggs = eggs.crack();
if(fridge.hasMilk) {
bowlOfEggs.add('milk');
} else {
bowlOfEggs.add('tears');
}
Some declarative (pseudo) code!
<Meal> <Eggs type="scrambled" /> </Meal>
The Paradigm
- Colocate features, not technologies
- Write mostly JavaScript
- Re-use the paradigm, not the code
- Always be rendering
Rendering?
Not delicious
meats!!!
Re-render
<Meal> <Eggs type="scrambled" /> </Meal>
<Meal> <Eggs type="fried" /> </Meal>
Great, good, excellent, let's go!
http://devj.im/tiyreact
What is React?
By jimthedev
What is React?
- 1,220