You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Below I have listed the file structure I have in my project as well as the Vite config file, if I create a component in the /src dir with a .tsx extension, the code does not have any red squiggly lines, but if I put the same code in the /lib dir, I get a red line that states: This JSX tag requires 'React' to be in scope, but it could not be found.ts(2874).
index.tsx
exportdefaultfunctionGrid(){return(<div>I am a grid</div>// ^^^^ This JSX tag requires 'React' to be in scope, but it could not be found.ts(2874)// This error only happens if this component is in the /lib folder, but it does not occur in the /src folder)}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Below I have listed the file structure I have in my project as well as the Vite config file, if I create a component in the
/src
dir with a.tsx
extension, the code does not have any red squiggly lines, but if I put the same code in the/lib
dir, I get a red line that states:This JSX tag requires 'React' to be in scope, but it could not be found.ts(2874)
.index.tsx
vite.config.ts
Beta Was this translation helpful? Give feedback.
All reactions