react component interface1 [Typescript] TS2339: Property 'gameState' does not exist on type 'Readonly<{}>'. javascript에서 typescript로 마이그레이션 중 다음 에러가 발생했다. 문제의 코드는 아래와 같다. import React from "react"; export class GameStateBar extends React.Component { constructor(props: any) { super(props); this.state = { gameState: "" }; } handleGameStateChange(e: any) { this.setState({ gameState: e.detail }); } handleRestart(e: any) { this.setState({ gameState: "" }); } componentDidMount() { window.addEventListener("g.. 2021. 10. 7. 이전 1 다음