Skip to content

Commit 304302b

Browse files
committed
history.match does not update state
1 parent 16fff9b commit 304302b

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

modules/useRoutes.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ function useRoutes(createHistory) {
7777
if (error) {
7878
callback(error);
7979
} else {
80-
state = { ...nextState, components };
81-
callback(null, state);
80+
callback(null, { ...nextState, components });
8281
}
8382
});
8483
}
@@ -113,8 +112,6 @@ function useRoutes(createHistory) {
113112
result = hooks[i](location);
114113
}
115114

116-
// Callback with the result from the first route
117-
// hook that has a non-null return value.
118115
callback(result);
119116
}
120117
});
@@ -133,8 +130,6 @@ function useRoutes(createHistory) {
133130
message = hooks[i]();
134131
}
135132

136-
// Return the result from the first route hook
137-
// that returns a prompt message.
138133
return message;
139134
}
140135
}

0 commit comments

Comments
 (0)