3. LOGISTICS
‣ Use the “General” Channel on Slack to post questions at any
point.
‣ I may ask you to refer code which is in the ‘react-hooks’ channel.
‣ We end when the talks end or by 5pm. Which ever occurs earlier.
16. BETTER SOLUTION?
PROBLEMS WITH CLASSES
‣ Not possible to break the components
into smaller components as the
stateful logic is all over the
place.
‣ Classes confuse both people and machines
‣ Classes don’t minify well
‣ Make hot reloading flaky and unreliable
Hooks don’t use classes.
17. BETTER SOLUTION?
EXPLICIT DATA FLOW & COMPOSITION PROBLEMS WITHIN COMPONENTS
‣ Mutually related code, that changes
together gets split apart.
‣ Unrelated code ends up combined in a
single method.
Hooks lets us organise related code in a
component together. (useEffect)
22. REUSABILITY
- How do we reuse code in React?
- If components are re-usable, why do
we need hooks?
- Why sharing functions does not help?
- What was the solution earlier?
25. REACT.JS WORKSHOP
SUMMARY
‣ Hooks are javascript functions.
‣ Hooks help in code reusability.
‣ Hooks help split a component into
smaller functions based on whats
related.
‣ Hooks are easy to share amongst
components or with community.
26. REACT.JS WORKSHOP
NEXT STEPS
▸ Read about hooks at https://reactjs.org/docs/hooks-
intro.html
▸ Start using hooks in your projects.