alibaba / ice

🚀 ice.js: The Progressive App Framework Based On React(基于 React 的渐进式应用框架)

Home Page:https://ice.work

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[QUESTION]弹窗如何继承auth

xmsz-stu opened this issue · comments

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

<Dialong /> 组件,或者调用 Dialog API 的时候把 useAuth 的指作为 A 组件的 props 传递

有没有类似store.Provider或者如何自己实现,因为有些Dialog里的组件是和页面共用的