Skip to content

Commit 1ad26bb

Browse files
committed
Merge pull request #36 from charpeni/replace-binded-functions-by-arrow-functions
Replace binded functions by arrow functions
2 parents 0851344 + 4df6e77 commit 1ad26bb

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

index.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -97,51 +97,51 @@ class Router extends React.Component {
9797
}
9898

9999
renderScene(route, navigator) {
100-
const goForward = function goForward(nextRoute) {
100+
const goForward = (nextRoute) => {
101101
navigator.push(
102102
Object.assign(nextRoute, { index: this.state.route.index + 1 || 1 })
103103
);
104104
this.emitter.emit('push', nextRoute);
105-
}.bind(this);
105+
};
106106

107-
const replaceRoute = function replaceRoute(nextRoute) {
107+
const replaceRoute = (nextRoute) => {
108108
navigator.replace(
109109
Object.assign(nextRoute, { index: this.state.route.index || 0 })
110110
);
111111
this.emitter.emit('replace', nextRoute);
112-
}.bind(this);
112+
};
113113

114-
const resetToRoute = function resetToRoute(nextRoute) {
114+
const resetToRoute = (nextRoute) => {
115115
navigator.resetTo(
116116
Object.assign(nextRoute, { index: 0 })
117117
);
118118
this.emitter.emit('resetTo', nextRoute);
119-
}.bind(this);
119+
};
120120

121-
const goBackwards = function goBackwards() {
121+
const goBackwards = () => {
122122
this.onBack(navigator);
123-
}.bind(this);
123+
};
124124

125-
const goToFirstRoute = function goToFirstRoute() {
125+
const goToFirstRoute = () => {
126126
navigator.popToTop();
127127
this.emitter.emit('popToTop');
128-
}.bind(this);
128+
};
129129

130-
const setRightProps = function setRightProps(props) {
130+
const setRightProps = (props) => {
131131
this.setState({ rightProps: props });
132-
}.bind(this);
132+
};
133133

134-
const setLeftProps = function setLeftProps(props) {
134+
const setLeftProps = (props) => {
135135
this.setState({ leftProps: props });
136-
}.bind(this);
136+
};
137137

138-
const setTitleProps = function setTitleProps(props) {
138+
const setTitleProps = (props) => {
139139
this.setState({ titleProps: props });
140-
}.bind(this);
140+
};
141141

142-
const customAction = function customAction(opts) {
142+
const customAction = (opts) => {
143143
this.customAction(opts);
144-
}.bind(this);
144+
};
145145

146146
const Content = route.component;
147147

0 commit comments

Comments
 (0)