- Advanced TypeScript Programming Projects
- Peter O'Hanlon
- 185字
- 2021-06-24 13:27:12
Our React App component
We have already touched on the use of components in React. By default, we will always have an App component. This is the component that will be rendered to the root element in our HTML. Our components derive from React.Component, so the start of our App component looks like the following:
import * as React from 'react';
import './App.css';
export default class App extends React.Component {
}
Of course, our component requires a well-known method to trigger the rendering of the component. It will not come as much of a surprise to learn that the method is called render. As we are using Bootstrap to display our UI, we want to be rendering out a component that relates to our Container div. To do this, we are going to use a Container component from reactstrap (and introduce the core component that we are going to use to display our interface):
import * as React from 'react';
import './App.css';
import Container from 'reactstrap/lib/Container';
import PersonalDetails from './PersonalDetails';
export default class App extends React.Component {
public render() {
return (
<Container>
<PersonalDetails />
</Container>
);
}
}
推薦閱讀
- Getting Started with oVirt 3.3
- Linux從零開始學(視頻教學版)
- Extending Bootstrap
- Alfresco 4 Enterprise Content Management Implementation
- Linux運維最佳實踐
- STM32庫開發(fā)實戰(zhàn)指南:基于STM32F4
- Linux內(nèi)核觀測技術(shù)BPF
- Linux基礎(chǔ)使用與案例
- INSTANT Galleria Howto
- Kali Linux高級滲透測試(原書第3版)
- Linux內(nèi)核API完全參考手冊(第2版)
- Windows Server 2008組網(wǎng)技術(shù)與實訓(第3版)
- Web Penetration Testing with Kali Linux(Third Edition)
- Angular權(quán)威教程
- Java EE 8 High Performance