Skip to content

Commit

Permalink
fix(methods): goTo and goBack are now bound to the instance
Browse files Browse the repository at this point in the history
Avoid having problems of context (eg: assign goBack to a button)
  • Loading branch information
AoDev committed Mar 27, 2019
1 parent 72e563e commit fc08bb8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/Router.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ export default class Router {
this.routes = routes
this.options = options
this.app = options.app
this.goBack = this.goBack.bind(this)
this.goTo = this.goTo.bind(this)
if (options.historyPlugin) {
this.history = options.historyPlugin.createHistory(this)
}
Expand Down

0 comments on commit fc08bb8

Please sign in to comment.