The parameter "key"val" implicitly has the type "any".

look at some materials but do not understand, the company requires to write in typescript, who can answer
clipboard.png

clipboard.png

problem description

The

parameter "key"val" implicitly has the type "any".
history does not exist and I am invalid if I use prop-types

the environmental background of the problems and what methods you have tried

related codes

/ / Please paste the code text below (do not replace the code with pictures)
import * as React from "react";
/ / import PropTypes from "prop-types";
export interface Props {

user: string;
pwd?: string;
key :any;

}

interface State {

user: string;
pwd?: string;

}
class Login extends React.Component < Props, State > {

constructor(props: Props) {
    super(props)
    this.state = {
        user: "",
        pwd: ""
    }
    this.register = this.register.bind(this)
}
register(){
    this.props.history.push("/register")
}
onInputChange(key,val) {
    this.setState({
        [key]:val
    })
    // // console.log(event.target.value)
    // this.setState({})
}
// handleLogin(){
//     this.props.login(this.state)
// }
render() {
    return (
        <div>
            <form>
                <div>
                    <label>:</label>
                    <input type="text" placeholder="" value={this.state.user} onChange={v => this.onInputChange("user",v)} />
                </div>
                <div>
                    <label>:</label>
                    <input type="text" placeholder="" value={this.state.pwd} onChange={v => this.onInputChange("pwd",v)} />
                </div>
                <button onClick={this.register}></button>
            </form>
        </div>
    )
}

}
/ / Login.propTypes = {
/ / register: PropTypes.string
/ /};

export default Login;

what result do you expect? What is the error message actually seen?

Jul.14,2021

  

No, the same mistakes

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e455a9-44b1d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e455a9-44b1d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?