reactjs - React router, path vs object, matching issues -


i have strange issues react router:

 <link to={{ pathname:      '/hols/tenerife/costa-del-silencio/alborada-beach-club.html',     query: { param1: 'true' }     }}>go page a</link> 

matches

<route path="/hols/:country/:area/:hotel" component={mylayout} /> 

yet doesn't match same route (it hits 404 route):

<link to="/hols/tenerife/costa-del-silencio/alborada-beach-club.html?param1=true">go page a</link> 

then... when try match on hash , try pass in string to attribute opposite results. i.e. this:

<link to="/hols/tenerife/costa-del-silencio/alborada-beach-club.html?param1=true#hashparam=true">go page b</link> 

matches this:

<route path="/hols/:country/:area/:hotel?:foo#:bar" component={mylayoutb} /> 

but doesn't:

    {{<link to={                       {                         pathname: '/hols/tenerife/costa-del-silencio/alborada-beach-club.html',                         query   : { param1: 'true' },                         hash    : '#hashparam=true',                       }}                     >                       go page b                     </link>}} 

if has experience react-router, appreciated. is expected behaviour? problem have migrate react, our pathnames , search strings need remain same, , new features matching on hash params.

note page needs match route, once page refreshed. ones work above, do, have had instances don't , go 404 react route.


Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -