-
Notifications
You must be signed in to change notification settings - Fork 12
Customizing Routes
Tim Scott edited this page Aug 27, 2017
·
6 revisions
A route is configuration object consisting of three fields:
Field | Purpose |
---|---|
path | The url path |
linkText | The text used in the link when you use AuthLinks
|
component | The react component that renders for the route |
Out of the box, React Devise ships with default routes. You can fully customize these upon initialization. For example, to change the path for the signup route:
initReactDevise({
// other config
routes: {
signup: {
path: '/signup-for-fun-and-profit'
}
}
});
Custom routes are deep merged with the defaults, so you only need to specify the properties you want to change. Say for example you're happy with the default path for the signup route, but you want to use a custom view component and link text:
initReactDevise({
// other config
routes: {
signup: {
linkText: 'Hey, Signup Now!',
component: MyFancySignupForm
}
}
});