mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-01-12 22:51:18 +08:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user