Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to add css based on route react

// do something when clicking on route 

function handler() {
  // do something;
}

<Route path='/' component={App}>
  <Route path="foo" component={Foo} onEnter={handler}/>
  <Route path="life" component={Life} onEnter={handler}/>
</Route>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #add #css #based #route #react
ADD COMMENT
Topic
Name
4+5 =