我正在使用以下方法检查是否启用了dex,同一方法在一个Fragment中返回true,在另一个Fragment中返回false,我的手机放在了Dex中。不明白怎么了...
const isDesktopLayout = (
ctx: React.Context<DesktopLayoutContextType> |
React.Context<MobileLayoutContextType>
): ctx is React.Context<DesktopLayoutContextType> => {
if (ctx.displayName === undefined) throw 'context displayName is undefined!'
return ctx.displayName === 'desktop'
}