fix: fix crash in useLinkTo when passing an object (#9800)

When an object was passed to the `to` parameter in `useLinkTo`, an error message would be thrown (Cannot find property 'root'). Apparently, this was introduced in commit 1d40279, where the `root` variable was removed.
This commit is contained in:
Giannis Macheras
2021-08-07 14:34:03 +03:00
committed by GitHub
parent 3aab9fd05e
commit dfd0cc78fe

View File

@@ -38,7 +38,7 @@ export default function useLinkTo<
if (typeof to !== 'string') {
// @ts-expect-error: This is fine
root.navigate(to.screen, to.params);
navigation.navigate(to.screen, to.params);
return;
}