Skip to content

Defining routes using arrow functions doesn't work #1597

@Kamaropoulos

Description

@Kamaropoulos

Defining a route using the following code:

Router.route('/', () => {
    this.render('myTemplate');
});

will print an error in the console:

Route dispatch never rendered. Did you forget to call this.next() in an onBeforeAction?

while the same code but with a regular function callback will work as expected:

Router.route('/', function() {
    this.render('myTemplate');
});

I know that the default way to define routes is with regular functions but shouldn't this theoretically work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions