reactjs - Redirection with React Router Component -


i'm having problem react-router-component. i'm trying make redirect library "soft" redirect (equivalent clicking link, opposed window.location = ...) can require .jsx component.

per docs should able call router.navigate(path) redirect.

when, example, call on page a, url in address bar changes page b desired. however, page a reloads, leaving address bar page b , display page a. suggestions?

you should able solve using navigation mixin.

then can use this.transitionto name of page.

var pageadd = react.createclass({      mixins : [router.navigation],      handlesubmit : function(e) {         e.preventdefault();          this.transitionto('pages');      },      render: function () {         return (             <form onsubmit={this.handlesubmit}>                 <button type="submit" classname="btn btn-default">submit</button>             </form>         );     } }); 

read more: https://github.com/rackt/react-router/blob/master/docs/api/mixins/navigation.md


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -