title: React Typescript: Argument of type '{ [x: number]: any; }' is not assignable to parameter of type
body: <p>I added onChange method in my project(React, TS, Mobx), but I am getting an error: <code>Argument of type '{ [x: number]: any; }' is not assignable to parameter of type</code> </p>
  
  <p>I am new to TypeScript and not sure why it's happening. What can be the problem?</p>
  
  <pre><code>(parameter) event: {
      target: {
          name: any;
          value: any;
      };
  }
  </code></pre>
  
  <blockquote>
    <p>Argument of type '{ [x: number]: any; }' is not assignable to
    parameter of type 'IAddPlayerFormState | ((prevState:
    Readonly, props: Readonly)
    => IAddPlayerFormState | Pick | null) | Pick&lt;...> | null'.</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/pVq7b.png" rel="noreferrer"><img src="https://i.stack.imgur.com/pVq7b.png" alt="enter image description here"></a></p>
  
  <pre><code>import React, { Component } from 'react';
  import ViewStore from '../../../store/ViewStore';
  import { TextField } from './../../../utils';
  
  interface IAddPlayerFormProps {
    viewStore?: ViewStore; // Optional ViewStore
  }
  
  interface IAddPlayerFormState {
    playerName: string;
    isDisabled: boolean;
  }
  
  class AddPlayerForm extends Component&lt;IAddPlayerFormProps, IAddPlayerFormState&gt; {
    constructor(props: Readonly&lt;IAddPlayerFormProps&gt;) {
      super(props);
  
      this.state = {
        isDisabled: false,
        playerName: '',
      };
    }
  
    public onChange(event: { target: { name: any; value: any; }; }) {
      this.setState({ [event.target.name]: event.target.value });
      console.log('On Change!');
    }
  
    public handleSubmit = () =&gt; {
      console.log('On submit!');
    }
  
    public render() {
      const { isDisabled } = this.state;
  
      return (
        &lt;form onSubmit={this.handleSubmit}&gt;
          &lt;TextField
            type="text"
            name="name"
            value={name}
            placeholder="Add player"
            onChange={this.onChange}
            disabled={isDisabled}
          /&gt;
  
          &lt;input type="submit" /&gt;
        &lt;/form&gt;
      );
    }
  }
  
  export default AddPlayerForm;
  </code></pre>