title: React Components using css files that are not imported to them
body: <p>Basically, I am using different css files for a reason. My problem is that when I am styling something in one css file, it affects some other components I have, not only the one where I import this css file.</p>
  
  <p>I think the problem is with react-router. I think it shares css files from every component i import to it. When I stop using a component in router, then its css files are not shared.</p>
  
  <p>But how do I do routes different way? I need to import all components to router to have links to my pages.</p>
  
  <p>I also tried to put routes into seperate files, it didn't help as well.</p>
  
  <p>That's how my file with routes looks like:</p>
  
  <pre><code>import React, { Component } from 'react';
  import {
    BrowserRouter as Router,
    Route
  } from 'react-router-dom';
  
  import './App.css';
  import LoginPage from '../pages/LoginPage.js';
  import Navbar from './Navbar.js';
  import MainPage from '../pages/MainPage.js';
  import SportsfieldsListPage from '../pages/SportsfieldsListPage.js';
  import MyProfilePage from '../pages/MyProfilePage.js';
  import SingleObjectPage from '../pages/SingleObjectPage.js';
  import ConfirmPage from '../pages/ConfirmPage.js';
  import AdminPage from '../pages/AdminPage.js';
  
  class App extends Component {
    render() {
      return (
        &lt;Router&gt;
          &lt;div className="container"&gt;
          &lt;Navbar /&gt;
            &lt;Route exact path="/" component={MainPage} /&gt;
            &lt;Route exact path="/listaBoisk" component={SportsfieldsListPage} /&gt;
            &lt;Route exact path="/LoginPage" component={LoginPage} /&gt;
            &lt;Route exact path="/MyProfilePage" component={MyProfilePage} /&gt;
            &lt;Route path="/object/:id" component={SingleObjectPage}/&gt;
            &lt;Route path ="/confirm/:id/:value" component={ConfirmPage}/&gt;
            &lt;Route path ="/adminPage" component={AdminPage}/&gt;
          &lt;/div&gt;
        &lt;/Router&gt;
      );
    }
  }
  
  export default App;
  </code></pre>