I started a new create react app with typescript and for any type error, the ui is covered by this black screen showing errors, i want to see type errors only in terminal
Compiled with problems:X
ERROR in src/App.tsx:10:45
TS2322: Type 'boolean' is not assignable to type 'string'. 8 | 9 |
10 | <Route path="/product" element={hi}> | ^^ 11 | 12 | </> 13 | );
Any way to fix this?
Assuming you are using create-react-app,
1- If you want to ignore for whole project. Create a ".env" file in the root of the project and put inside it these settings.
TSC_COMPILE_ON_ERROR=true
ESLINT_NO_DEV_ERRORS=true
2-If you want to ignore just that line. Just above the line put this comment.
// @ts-ignore