mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
Templates: update React's component's State and Property type
This commit is contained in:
@@ -7,7 +7,7 @@ import * as WeatherForecasts from '../store/WeatherForecasts';
|
||||
|
||||
type CounterProps = CounterStore.CounterState & typeof CounterStore.actionCreators;
|
||||
|
||||
class Counter extends React.Component<CounterProps, void> {
|
||||
class Counter extends React.Component<CounterProps, {}> {
|
||||
public render() {
|
||||
return <div>
|
||||
<h1>Counter</h1>
|
||||
|
||||
@@ -10,7 +10,7 @@ type WeatherForecastProps =
|
||||
& typeof WeatherForecastsState.actionCreators // ... plus action creators we've requested
|
||||
& { params: { startDateIndex: string } }; // ... plus incoming routing parameters
|
||||
|
||||
class FetchData extends React.Component<WeatherForecastProps, void> {
|
||||
class FetchData extends React.Component<WeatherForecastProps, {}> {
|
||||
componentWillMount() {
|
||||
// This method runs when the component is first added to the page
|
||||
let startDateIndex = parseInt(this.props.params.startDateIndex) || 0;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as React from 'react';
|
||||
|
||||
export default class Home extends React.Component<void, void> {
|
||||
export default class Home extends React.Component<{}, {}> {
|
||||
public render() {
|
||||
return <div>
|
||||
<h1>Hello, world!</h1>
|
||||
|
||||
@@ -5,7 +5,7 @@ export interface LayoutProps {
|
||||
body: React.ReactElement<any>;
|
||||
}
|
||||
|
||||
export class Layout extends React.Component<LayoutProps, void> {
|
||||
export class Layout extends React.Component<LayoutProps, {}> {
|
||||
public render() {
|
||||
return <div className='container-fluid'>
|
||||
<div className='row'>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as React from 'react';
|
||||
import { Link } from 'react-router';
|
||||
|
||||
export class NavMenu extends React.Component<any, void> {
|
||||
export class NavMenu extends React.Component<{}, {}> {
|
||||
public render() {
|
||||
return <div className='main-nav'>
|
||||
<div className='navbar navbar-inverse'>
|
||||
|
||||
Reference in New Issue
Block a user