Suppose I have a component ABC.tsx in which I have imported CSS file ABC.css.
ABC.css
.header{
width:10%;
}
Again, I have another component XYZ.tsx in which I have imported CSS file XYZ.css.
XYZ.css
.header{
width:100%;
}
These classes are used in their respective component.
However, when I run my app, I notice that class from XYZ is being applied to ABC or vice-versa. Shouldn't classes be applied locally only from those CSS files to the component in which they were imported?
Does react process all CSS and put them before all HTML tags and they are applied according to the order in which they were processed? I am saying this because I can see in in the inspect's element tag there are 2 tag before the HTML begins, both containing the same code.