Skip to content

Commit

Permalink
Preview it live
Browse files Browse the repository at this point in the history
  • Loading branch information
willnode committed Jul 27, 2024
1 parent 6d8b742 commit c96499e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/components/editor/puck.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -418,13 +418,12 @@ const config: Config = {
},
},
render({ component, data, classes }) {
let ctx = useContext(dropZoneContext);
data = useTemplArray(data);
let style = useStyle(classes);
if (ctx?.mode == "edit") {
return <div style={style}>Custom component {`<${component?.identifier || '??'} />`} will render here</div>;
} else {
if (component) {
return <ComponentRender style={style} component={component} data={data} />;
} else {
return <div style={style}>Choose a component</div>;
}
}
}
Expand Down

0 comments on commit c96499e

Please sign in to comment.