Skip to content

Commit

Permalink
fix: 🐛 解决切换属性配置面板时,更新 value 导致的 Maximum call stack size exceeded
Browse files Browse the repository at this point in the history
  • Loading branch information
limaofeng committed Aug 28, 2021
1 parent 5c111ae commit 070ff98
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ storybook-static
node_modules
.cache
dist
coverage
2 changes: 1 addition & 1 deletion src/components/aside/Aside.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function Aside(_: AsideProps) {
return;
}
return watchValue((value) => {
cache.current = value;
cache.current.value = value;
forceRender();
});
}, [watchValue]);
Expand Down
4 changes: 2 additions & 2 deletions src/utils/BlockAside.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { OverlayScrollbarsComponent } from 'overlayscrollbars-react';
import { ICustomizer, IFieldGroup } from 'sunmao';

import CurrentElementInformation from '../properties/CurrentElementInformation';
import FormPanel from '../properties/DynaActionForm';
import DynaActionForm from '../properties/DynaActionForm';
import { AsideTabPane, DEFAULT_GROUP_ID } from '../typings';

export const DynaActionFormContext = React.createContext<any>({});
Expand All @@ -17,7 +17,7 @@ export function createDynaActionForm(customizer: ICustomizer, namespace: string
return (
<div ref={container} className="sketch-configuration-body scrollbars-visible">
<OverlayScrollbarsComponent options={{ scrollbars: { autoHide: 'scroll' } }}>
<FormPanel library={namespace} value={value} onChange={handleChange} customizer={customizer!} />
<DynaActionForm library={namespace} value={value} onChange={handleChange} customizer={customizer!} />
</OverlayScrollbarsComponent>
</div>
);
Expand Down

0 comments on commit 070ff98

Please sign in to comment.