Я не понимаю, почему у меня этот тип ошибки
Parameter 'props' implicitly has an 'any' type.
Потому что я использовал iterface прежде, чтобы использовать реквизиты в методе конструктора.Ниже я помещаю весь компонент реакции, когда у меня есть проблема
import { connect } from 'react-redux';
import { FetchPokemon } from '../../actions';
import * as React from 'react';
import { HeaderComponent } from './HeaderComponent';
import {IStoreState} from '../../types';
interface IProps {
pokemon: object[];
FetchPokemon: () => void;
}
interface IState {
example: boolean
}
class HeaderContainer extends React.Component<IProps, IState> {
constructor(props) {
super(props);
this.state = {
example: false
}
this.FetchAction = this.FetchAction.bind(this);
}
public FetchAction = () => {
this.props.FetchPokemon()
}
public render() {
return (
<div>
{console.log(this.props)}
<HeaderComponent fetchAction={this.FetchAction}/>
</div>
)
}
}
const mapStateToProps = (state: IStoreState) => ({
pokemon: state.fetchPokemon
})
export default connect(mapStateToProps, {FetchPokemon})(HeaderContainer) as any;
У кого-нибудь есть идеи?