목록F4. Library of Languages/JavaScript (JS) (2)
Silver Library (Archived)
Abstract. To utilise major feature in react.js, here is the example of composing the clock display. const root = ReactDOM.createRoot(document.getElementById('root')); class Clock extends React.Component { render() { return ( Hello, world! It is {this.props.date.toLocaleTimeString()}. ); } } function tick() { root.render(); } setInterval(tick, 1000); Source - codepen, Dan Abramov
The point is; how to make it like expert? A function's this keyword behaves a little differently in JavaScript compared to other languages. It also has some differences between strict mode and non-strict mode. In most cases, the value of this is determined by how a function is called (runtime binding). It can't be set by assignment during execution, and it may be different each time the function..