test_component.tsx 403 B

123456789101112131415161718
  1. import React, {useState} from 'react';
  2. function TestComponent(): React.FunctionComponentElement<void> {
  3. const [text, setText] = useState('');
  4. return (
  5. <div>
  6. <div>
  7. <h1>React + TypeScript lives!</h1>
  8. </div>
  9. Is React working? Test here: {text}
  10. <hr />
  11. <input onChange={(e): void => setText(e.target.value)} />
  12. </div>
  13. );
  14. }
  15. export default TestComponent;