import React, { MouseEvent } from 'react'; import SButton from '@components/SButton'; import "./style.less"; interface Props { name: string; } interface State { info: string; } class Page extends React.Component { constructor(props: Props) { super(props); this.state = { info: '' }; this.handlePassParamToParent = this.handlePassParamToParent.bind(this); } render() { const { name } = this.props; const { info } = this.state; return (
name: {name}
info: {info}
); } private changeExtra() { this.setState({ info: Math.floor(Math.random() * 10000) + '' }); } handlePassParamToParent() { } } export default Page;