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
Post a Comment