利用antd-pro使用umi的qiankun插件做微前端,子应用如何使用主应用的组件, 看下面的代码:使用的原生的button传到子应用可以使用,但是使用antd的Button传递过去使用就会报错,凡是用的antd的组件都不行 #8750
sunlianglife
started this conversation in
General
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
// app.tsx
export const useQiankunStateForSlave = () => ({
MainButton: (props: any) => <MainButton {...props} />,
mainData: {
aa: 11,
},
});
// MainButton 组件
export default (props: any) => {
return (
<Button {...props} style={{ minWidth: 80, ...props?.style }}>
{props?.children}
);
};
All reactions