I set up a not found route in flow router and it works:
FlowRouter.notFound = {
action: function() {
ReactLayout.render(MainLayout, {content: <NotFound />});
}
};
However, I have a route that takes a project ID param. To catch bad ID’s I have the following code:
render() {
let content = null;
if( this.data.projectLoading ){
content = <Loading />;
} else {
if(this.data.project){
content = <ProjectContent project={this.data.project}/>;
} else {
//Project Not found
FlowRouter.go(FlowRouter.path('notFound'));
}
}
return <div>{content}</div>;
},
It works but not correctly. Instead of routing to the not found page, it trys to find a notFound route and then fails to the not found page. Is there a better way to redirect to my not found page?