Please enable JavaScript.
Coggle requires JavaScript to display documents.
Requirements (Components must act like pure functions), React (Components…
-
React
Components and Props
-
-
Props
Impure functions
Changes input, output is not predicable.
function withdraw(account, amount) {
account.total -= amount;
}
Pure Functions
Are read-only, must never alter its own props.
-
function sum(a, b) {
return a + b;
}
-
State and Lifecycle
-
Lifecycle
-
componentDidMount
-
-
componentDidMount() {
this.timerID = setInterval(
() => this.tick(),
1000
);
}
-
-
-
-
-
-
-
-
-