03-Application-Architecture FrontEnd 01-Frameworks React
<< ---------------------------------------------------------------- >>
--- Last Modified: $= dv.current().file.mtime
Data fetching
<< ---------------------------------------------------------------- >>
https://www.youtube.com/watch?v=00lxm_doFYw
Submitting Forms
Controlled Vs. Uncontrolled Components
in Uncontrolled components, the data sending is handled by the dom(you use a useRef for this) Controlled Components, the states and behavior is managed by useState hooks.
Fetch on Render and Render on Fetch
Fetch on Render:
- user fetches the html
- parses HTML fetches .JS scripts
- JS renders components, requests USER info
- Server Authenticates and sends UserInfo
- Browser renders UserInfo, needs to request FriendsList
- Server Authenticates and responds with FriendsList
- Browser Renders the list and request Individual Friend Infor
- Server Authenticates and responds with Individual Friend Info There is a lot of water falling here.
Render on Fetch:
- user fetches the HTML
- the server does authentication, getinng userInfo, FriendsList, individual friends
- User parses HTML, fetches JS, awaits the rest of the data.
- Server finishes process the firendslist and individual friends and userinfo requests and sends them to the client to be displayed Basically this one does no waterfalling so it gets a lot faster.