-
Notifications
You must be signed in to change notification settings - Fork 479
Open
Description
I am researching some example code about React based on director.js.
The example code shows that I have to bind thisArg to make sure the app could work well.
Could you please tell me why I have to bind this in router function?
Here is the snippet of the code.
componentDidMount: function () {
var setState = this.setState;
var router = Router({
'/': setState.bind(this, {nowShowing: app.ALL_TODOS}),
'/active': setState.bind(this, {nowShowing: app.ACTIVE_TODOS}),
'/completed': setState.bind(this, {nowShowing: app.COMPLETED_TODOS})
});
router.init('/');
},
Metadata
Metadata
Assignees
Labels
No labels