CSE 134B Lecture Notes - Lecture 8: Dom Events, React (Javascript Library), Web Application

64 views4 pages

Document Summary

Used for building user interfaces (the look of the page) Flexible - focuses on the view of the ui, doesn"t care where data comes from. Modular - easy to scale (only part of your web app using react) Rendering a model to the dom events. React focuses on the view & events (i. e. the view of the mvc) Take updates to the browser (dom) ( repaints the entire dom) Generates html in js (not enhancing like angular) Virtual dom (render html tree virtually and react will update the changes only ) Use a class: class hello extends react. component { classname render() { return(); Buttons class button extends react. component { handleclick = () => {}; render() { Handle state class button extends react. component { state = { counter: 0}; handleclick = () => { Return { counter: prevstate. counter + 1 } render() { this - component instance we are sending to the dom this. setstate - prevents race conditions .

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents