In react router 4, how does one negate a route / path using regex? -


say have route switch statement following:

render () {     <pre>         <switch>             <route path="/foo" render={render}>             <route path="/bar" render={renderbar}>             <route path="/" render={renderhome}>              {/* how express except home page ?*/}              <route render={renderfourohfour}>         </switch>     </pre> } 

how write route excludes except home page given above example? write regex? if i've tried like

path={^(?!.*(home))}

with regex react router v4 tester: https://pshrmn.github.io/route-tester/#/


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -