Skip to content

Commit

Permalink
feat: fix sandbox
Browse files Browse the repository at this point in the history
  • Loading branch information
phshy0607 committed Apr 18, 2022
1 parent 523d596 commit d45f5df
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/client/components/SandBox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ const Sandbox: React.FC = () => {
const ComponentRef = useRef<React.FC>(() => <></>);

useEffect(() => {
if (sandboxes[query.moduleId]) {
sandboxes[query.moduleId]().then((res) => {
const getter = sandboxes[decodeURI(query.moduleId)];
if (getter) {
getter().then((res) => {
const { default: Component } = res;
ComponentRef.current = Component;
update({});
Expand Down

0 comments on commit d45f5df

Please sign in to comment.