Skip to content

Commit 75f169a

Browse files
committed
fix(UIRouter): Apply config before registering states
If the optional config applies something that state declarations depend on, such as custom parameter type definitions, then it needs to be applied *before* states are registered.
1 parent fd6c074 commit 75f169a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/UIRouter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ export class UIRouter extends Component<UIRouterProps, UIRouterState> {
6969
this.router = new UIRouterReact();
7070
this.router.plugin(servicesPlugin);
7171
props.plugins.forEach(plugin => this.router.plugin(plugin));
72-
(props.states || []).forEach(state => this.router.stateRegistry.register(state));
7372
if (props.config) props.config(this.router);
73+
(props.states || []).forEach(state => this.router.stateRegistry.register(state));
7474
} else {
7575
throw InstanceOrPluginsMissingError;
7676
}

0 commit comments

Comments
 (0)