请教umi如何使用mobx?使用装饰器语法+mobx HOC,目前看起来无法正常触发渲染。 #11947
-
版本: 使用mobx状态的组件 const { TextArea } = Input; const CCFlow = observer(() => { return ( <div className="draw-container" style={{ width: '100%' }} ref={ref} > <Button icon={} onClick={() => setEditAreaVisible()} /> <Button icon={} onClick={() => console.log(editAreaVisible)} /> {editAreaVisible} {editAreaVisible ? 111 : null}); }); export default CCFlow; class GraphStateVM1 { @action export const graphStateVM1 = new GraphStateVM1(); export default defineConfig({ |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
不需要自己配 如有问题,需要给一个最小复现仓库。 |
Beta Was this translation helpful? Give feedback.
以下是我可以运行的示例: