score:2

Accepted answer

it seems like you are trying to use react functional components, as you are using the usestate hook.

in that case, you should not be creating a class and extending it from react.component, as those are for defining class components.

this is how you can define functional components using react and typescript.

interface initialstateprops {
  eventinfo: {
    name: string; 
    location: string;
  }
}

const dashboard: react.fc = () => {
  const [formvalues, setformvalues] = usestate<initialstateprops>({
    eventinfo: {
      name: '',
      location: ''
    }
  })

  return <div></div>

};

Related Query

More Query from same tag