I want to learn-by-doing Typescript with React so I've migrated manually from JS to TS in my create-react-app but my default testing file App.test.ts:
import { render, screen } from '@testing-library/react';
import App from './App';
test('renders learn react link', () => {
render(<App />); // There's an error here
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});
has this error:
'App' refers to a value, but is being used as a type here. Did you mean 'typeof App'?