Skip to content

Commit 3c00270

Browse files
committed
fix(UISref): use root context when it's not nested in any UIView
1 parent 3c0ffc6 commit 3c00270

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/UISref.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ export class UISref extends Component<IProps,any> {
3232

3333
getOptions = () => {
3434
let parent: UIViewAddress = this.context['parentUIViewAddress'];
35-
let defOpts = { relative: parent.context, inherit: true };
35+
let parentContext = parent && parent.context || UIRouterReact.instance.stateRegistry.root();
36+
let defOpts = { relative: parentContext, inherit: true };
3637
return extend(defOpts, this.props.options || {});
3738
}
3839

0 commit comments

Comments
 (0)