M
M
msdosx862018-04-29 18:25:53
css
msdosx86, 2018-04-29 18:25:53

Why am I getting styles from other .css files in React?

<Switch>
         <Route exact path="/" component={Home} />
         <Route path="/search" component={Search} />
         <Route path="/playlist/:id" component={Playlist} />
</Switch>
I have routing
Each component has its own .css file with styles. The Search component also has a 'tag' class that is not styled in any way in the .css file, at the same time, the Playlist component has exactly the same div, but already in the .css of this component there are styles for the 'tag' class, somehow miraculously I from the Search component I get styles from the Playlist component. Tell us what the secret is and what to do, otherwise it is wildly inconvenient. Thanks <div className="tag"></div>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
davidnum95, 2018-04-29
@davidnum95

You don't need to use any BEMs in react. Use css modules.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question