Making a test project with React on debian 10 with VScode on Windows 8.1, when using the command yarn start
in project folder, then an error comes out:
./src/App.js
Line 6: 'React' must be in scope when using JSX react/react-in-jsx-scope
Line 7: 'React' must be in scope when using JSX react/react-in-jsx-scope
Line 8: 'React' must be in scope when using JSX react/react-in-jsx-scope
Line 9: 'React' must be in scope when using JSX react/react-in-jsx-scope
Line 10: 'React' must be in scope when using JSX react/react-in-jsx-scope
Line 12: 'React' must be in scope when using JSX react/react-in-jsx-scope
solutions with import React from 'react';
or "react/react-in-jsx-scope": "off"
is didnt work. What else could be the problem?
2
Answers
import React from ‘react’
This will resolve the problem
I was having the same issue, it got solved by running npm audit fix –force.
I would try reinstalling the packages.