[Router] Android: "组件状态更新,但尚未装载"来自 useLinking getInitialURL().then → setLastUnhandledLink
作者: msynthese创建于 2026年9月17日更新于 2026年9月17日
标签needs reviewcontributor: external
NavigationContainercallsgetInitialState()during its first render, fromuseThenable'suseState(create)initializer.- On Android,
getInitialURLWithTimeout()always returns a promise (Promise.race([Linking.getInitialURL(), timeout])), and expo-router's owngetInitialURLinlink/linking.jswraps it again:Promise.resolve(...).then(url => parseExpoGoUrlFromListener(url) ?? getRootURL()). So the resolved value is always a string on Android, even for a home-screen launch (it becomes the root URL). On iOS the same function returns synchronously viaExpoLinking.getLinkingURL(), so there is no async gap and no warning. - In
fork/useLinking.native.js,getInitialStatedoes:
内容来源: expo/expo