This is a simple example of a React component.
16 | 17 |Current count: { this.props.count }
18 | 19 | 20 |This component demonstrates fetching data from the server and working with URL parameters.
30 | { this.renderForecastsTable() } 31 | { this.renderPagination() } 32 |Date | 40 |Temp. (C) | 41 |Temp. (F) | 42 |Summary | 43 |
---|---|---|---|
{ forecast.dateFormatted } | 49 |{ forecast.temperatureC } | 50 |{ forecast.temperatureF } | 51 |{ forecast.summary } | 52 |
63 | Previous 64 | Next 65 | { this.props.isLoading ? Loading... : [] } 66 |
; 67 | } 68 | } 69 | 70 | export default connect( 71 | (state: ApplicationState) => state.weatherForecasts, // Selects which state properties are merged into the component's props 72 | WeatherForecastsState.actionCreators // Selects which action creators are merged into the component's props 73 | )(FetchData); 74 | -------------------------------------------------------------------------------- /ClientApp/components/Home.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | export default class Home extends React.ComponentWelcome to your new single-page application, built with:
8 |To help you get started, we've also set up:
15 |webpack
build tool. Your client-side resources are dynamically built on demand. Updates are available as soon as you modify any file.webpack
build tool produces minified static CSS and JavaScript files.