Open
Description
I'm using FlowRouter & react, and i'm encountering the issue with AccountsTemplates.configureRoute
As your instruction
// routes.jsx
AccountsTemplates.configureRoute('signIn', {
layoutType: 'blaze-to-react',
name: 'signin',
path: '/login',
template: 'myLogin',
layoutTemplate: CustomLayout,
layoutRegions: {
nav: <CustomNav />,
footer: <CustomFooter />
},
contentRegion: 'main'
});
But i got error Match fail
, then I check the code inside this package https://github.com/meteor-useraccounts/flow-routing/blob/master/lib/core.js - line 26 & 72
var ROUTE_PAT = {
name: Match.Optional(String),
path: Match.Optional(String),
template: Match.Optional(String),
layoutTemplate: Match.Optional(String),
renderLayout: Match.Optional(Object),
contentRange: Match.Optional(String),
redirect: Match.Optional(Match.OneOf(String, Match.Where(_.isFunction))),
};
AccountsTemplates.configureRoute = function(route, options) {
check(route, String);
check(options, Match.OneOf(undefined, Match.ObjectIncluding(ROUTE_PAT)));
options = _.clone(options);
The problem is check(options, Match.OneOf(undefined, Match.ObjectIncluding(ROUTE_PAT)));
in ROUTE_PAT, there is a property layoutTemplate: Match.Optional(String)
but i'm using react and as your instruction for AccountsTemplates.configureRoute is layoutTemplate: CustomLayout
. That's why I got error Match fail
. Please fix it
Metadata
Metadata
Assignees
Labels
No labels