[QUESTION]弹窗如何继承auth
xmsz-stu opened this issue · comments
Chen Shi Jian commented
Describe the bug
import { useAuth } from 'ice';
Dialog.show({
content: (
<A />
),
});
const A = () => {
console.log(600, useAuth());
return <div />;
};
这里组件拿到的是null
Expected behavior
弹窗能获取到useAuth数据
Actual behavior
No response
Version of ice.js
2.x
Content of build.json or ice.config.mts
No response
Additional context
No response
ClarkXia commented
用 <Dialong />
组件,或者调用 Dialog API 的时候把 useAuth 的指作为 A 组件的 props 传递
Chen Shi Jian commented
有没有类似store.Provider或者如何自己实现,因为有些Dialog里的组件是和页面共用的