Estou tendo problemas ao declarar {this.props.children}
, por algum motivo está dando erro quando tento declarar em uma class React.Component
.
import style from "./square.module.scss";
import React from "react";
class Square extends React.Component {
render(){
return (
<button className={style.square} onClick={() => console.log('Foi Clicado')}>
{this.props.children}
</button>);
}
}
export default Square;
o Erro Apresentado é
[{ "owner": "typescript", "code": "2339", "message": "Property 'children' does not exist on type 'Readonly<{}>'.", "source": "ts",