Add <any, any> props/state to React components to prevent compiler errors
This commit is contained in:
Родитель
88425249ea
Коммит
4c440c8ac3
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
export class App extends React.Component {
|
export class App extends React.Component<any, any> {
|
||||||
render() {
|
render() {
|
||||||
let text = 'My App';
|
let text = 'My App';
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
export class Counter extends React.Component {
|
export class Counter extends React.Component<any, any> {
|
||||||
render() {
|
render() {
|
||||||
return <p>hello</p>;
|
return <p>hello</p>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Counter } from './components/Counter';
|
import { Counter } from './components/Counter';
|
||||||
|
|
||||||
export class App extends React.Component {
|
export class App extends React.Component<any, any> {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div className="App">
|
<div className="App">
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { TodoFooter } from './components/TodoFooter';
|
||||||
import { TodoHeader } from './components/TodoHeader';
|
import { TodoHeader } from './components/TodoHeader';
|
||||||
import { TodoList } from './components/TodoList';
|
import { TodoList } from './components/TodoList';
|
||||||
|
|
||||||
export class TodoApp extends React.Component {
|
export class TodoApp extends React.Component<any, any> {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
export class TodoHeader extends React.Component {
|
export class TodoHeader extends React.Component<any, any> {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<header>
|
<header>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
export class TodoListItem extends React.Component {
|
export class TodoListItem extends React.Component<any, any> {
|
||||||
render() {
|
render() {
|
||||||
return <div />;
|
return <div />;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { TodoFooter } from './components/TodoFooter';
|
||||||
import { TodoHeader } from './components/TodoHeader';
|
import { TodoHeader } from './components/TodoHeader';
|
||||||
import { TodoList } from './components/TodoList';
|
import { TodoList } from './components/TodoList';
|
||||||
|
|
||||||
export class TodoApp extends React.Component {
|
export class TodoApp extends React.Component<any, any> {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
export class TodoHeader extends React.Component {
|
export class TodoHeader extends React.Component<any, any> {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<header>
|
<header>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
export class TodoListItem extends React.Component {
|
export class TodoListItem extends React.Component<any, any> {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<li className="todo">
|
<li className="todo">
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { TodoFooter } from './components/TodoFooter';
|
||||||
import { TodoHeader } from './components/TodoHeader';
|
import { TodoHeader } from './components/TodoHeader';
|
||||||
import { TodoList } from './components/TodoList';
|
import { TodoList } from './components/TodoList';
|
||||||
|
|
||||||
export class TodoApp extends React.Component {
|
export class TodoApp extends React.Component<any, any> {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
export class TodoHeader extends React.Component {
|
export class TodoHeader extends React.Component<any, any> {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<header>
|
<header>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
export class TodoListItem extends React.Component {
|
export class TodoListItem extends React.Component<any, any> {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<li className="todo">
|
<li className="todo">
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { TodoFooter } from './components/TodoFooter';
|
||||||
import { TodoHeader } from './components/TodoHeader';
|
import { TodoHeader } from './components/TodoHeader';
|
||||||
import { TodoList } from './components/TodoList';
|
import { TodoList } from './components/TodoList';
|
||||||
|
|
||||||
export class TodoApp extends React.Component {
|
export class TodoApp extends React.Component<any, any> {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
export class TodoListItem extends React.Component {
|
export class TodoListItem extends React.Component<any, any> {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<li className="todo">
|
<li className="todo">
|
||||||
|
|
Загрузка…
Ссылка в новой задаче