SHARE
TWEET

Untitled

a guest Jul 18th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class App extends React.Component {
  2.   render() {
  3.     return (
  4.       <div>
  5.         <BannerTop />
  6.  
  7.         <h1>Lorem ipsum</h1>
  8.         <Navigation />
  9.         <Switch>
  10.           <Route path='/o-nas' strict exact component={AboutUs} />
  11.           <Route path='/' strict exact component={Home} />
  12.           <Redirect to='/' />
  13.         </Switch>
  14.       </div>
  15.     );
  16.   }
  17. }
  18.      
  19. class BannerTop extends Component {
  20.   state = {};
  21.   render() {
  22.     return (
  23.       <section className={this.changeClass()} id='banner-top'>
  24.         <div className='container'> Lorem </div>
  25.       </section>
  26.     );
  27.   }
  28.  
  29.   changeClass = () => {
  30.     console.log(this.props.location);
  31.     return window.location.pathname === '/' ? 'home' : 'other';
  32.   };
  33. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top