I'm trying to add some pages in typescript, and since I can only import .ts files in .ts or .tsx files, I renamed "Index.js" to "Index.tsx" and "App.js" to "App.tsx".
Now I'm getting the following error:
ERROR in ./src/index.tsx 7:0-24
Module not found: Error: Can't resolve './App'
Index.tsx
ReactDOM.render(
<React.StrictMode>
<BrowserRouter>
<App />
</BrowserRouter>
</React.StrictMode>,
document.getElementById("root")
);
App.tsx
function App() {
return (
<Provider store={store}>
<div>hi</div>
</Provider>
);
}
export default App;
Why can't Index.tsx resolve App.tsx? I created the project with create-react-app and I'm using React 17.0.2.