Just like Angular, React is component based. Angular is called a framework, whereas React is called a library. This means that Angular provides a lot of different functionalities and React provides one functionality, views. In the first two chapters, we used the HTTP service of Angular. React does not provide such a service, but you can use other libraries from npm
instead.
A component is a class that has a render method. That method will render the view and is the replacement of the template in Angular. A simple component would look like the following:
export class Example extends React.Component<{}, {}> { render() { const name = "World"; return ( <div> Hello, { name }! <button onClick={() => alert("Hello")}> Click me </button> </div> ); } }
As you can see, you...