#50282·expo

[Router] Android: "组件状态更新,但尚未装载"来自 useLinking getInitialURL().then → setLastUnhandledLink

作者: msynthese创建于 2026年9月17日更新于 2026年9月17日
标签needs reviewcontributor: external
  1. NavigationContainer calls getInitialState() during its first render, from useThenable's useState(create) initializer.
  2. On Android, getInitialURLWithTimeout() always returns a promise (Promise.race([Linking.getInitialURL(), timeout])), and expo-router's own getInitialURL in link/linking.js wraps 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 via ExpoLinking.getLinkingURL(), so there is no async gap and no warning.
  3. In fork/useLinking.native.js, getInitialState does: