https://www.youtube.com/watch?v=ozI4V_29fj4
- Script writer → Cast
- Server → Client
React Server Components
Cat Names
- hard code
- request from server(maybe network error)
- how to be low latency
- client code in the server side
A single program separate to two different devices
- in react, u can lift state up
- what if u can lift data up in the program
- lift data up to a parent computer
- simplify json request to file reading
- u can put file reading to another module
- extract random cat to the server side
Code is too messy now
- move inessential part to the problem
- but i wouldn’t want to write code like this
- don’t want write code inside of string
- not really convenient to add new feature
How to add new feature
- function CatNameGenerator
- separate CatNameGenerator and RevealButton
Why do this
- we can do all the things we can do with components.