import React, { MouseEvent, createRef, forwardRef } from 'react'; import Box1 from './box1'; interface Props { } interface State { inputRef?: React.RefObject; } /** * https://reactjs.org/docs/react-api.html#reactforwardref */ class Page extends React.Component { constructor(props: Props) { super(props); this.state = { inputRef: createRef() }; } render() { const { inputRef } = this.state; return (
); } } export default Page;