DEV Community

Why do React need to be in scope for JSX ?

Chandelier Axel on September 20, 2021

React must be in scope when using JSX Quite an annoying error, right ? What does it even mean anyway, you simply wrote a pretty basic co...
Collapse
 
simteledev profile image
Okwa Simon Ogbu

Thanks for this man, is really helpful

Collapse
 
creator_yudai profile image
Yudai H

You just saved my day sir ❤️

Collapse
 
jeluchez profile image
Jeluchez

excelent

Collapse
 
alaa_courdova profile image
Alaa Courdova

thats was helpful ,, thank you

Collapse
 
patriick_siqueira profile image
Patrick Siqueira

Oh my god, your post is great. You write very well. Not only did I solve my mistake, I learned a little more. simply thank you.

Collapse
 
chandelieraxel profile image
Chandelier Axel

My pleasure, I'm glad you learnt something along the way !

Collapse
 
c00p3r14 profile image
C00P3R14

Hi Chandelier. Your post is very informative. Thanks for that. However, I am struggling to figure out what file is used to switch off these rules and where is it found from the react App folder. Kindly specify. Your prompt assistance will be greatly appreciated.

Collapse
 
chandelieraxel profile image
Chandelier Axel

Hi ! Thanks for the feedback !

First, check that Eslint is properly installed. You should have, at the root of your project, a file names eslint.something. If not, feel free to check the documentation : eslint.org/docs/user-guide/configu... in order to create a proper one.
Then, all you have to do is to add the rules under the "rules" section of the file.

Collapse
 
crazyoptimist profile image
crazyoptimist

Content very well done. Thank you!

Collapse
 
romaintrotard profile image
Romain Trotard

Quick and effective article. Well done :)

Collapse
 
chandelieraxel profile image
Chandelier Axel

Thanks !

Collapse
 
adeelalam profile image
Adeel Alam

You rock buddy! {props.applauds}

Collapse
 
chandelieraxel profile image
Chandelier Axel

Thanks ! :D

Collapse
 
aaaasif profile image
Abdullah Al Asif

My pleasure, You just saved my day sir ❤️

Collapse
 
igortimonin profile image
Igor Timonin

This error can appear not only because of the old version of React, but also because of the outdated version of Node.js - below 17