From the course: The DOM in JavaScript, jQuery, AngularJS, and React
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Live updates for content
From the course: The DOM in JavaScript, jQuery, AngularJS, and React
Live updates for content
- [Instructor] ReactJS provides two methods for live updates. One is through a controlled component, and the other is through the uncontrolled component. In the controlled component, the state of the input element, such as the input, select, or the text area element, is controlled by React. However, the caveat is that you would need to write an event handler for each element to handle how data can change and then sends the input state through the React component. In this movie, I'll be doing my examples only through the controlled component, which is the preferred method. So in this example page, I'm going to add another div type below this to include a new ID called Liveupdate. Okay, so I just want to save this file and load the browser. It looks something like this. I want to put a message here, like this big bold text here, and below there I'll put a checkbox, for like a text for like a to-do list, and when you click the checkbox, it's going to change its state, and then that…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.