Skip to content

Commit

Permalink
fix rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Jan 3, 2021
1 parent 53e0676 commit 797048d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions docs/src/modules/components/DemoSandboxed.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function FramedDemo(props) {
createCache({
key: 'iframe-demo',
prepend: true,
container: document.body,
container: document.head,
}),
[document],
);
Expand Down Expand Up @@ -68,7 +68,8 @@ const useStyles = makeStyles(
);

function DemoFrame(props) {
const { children, title, ...other } = props;
const { children, name, ...other } = props;
const title = `${name} demo`;
const classes = useStyles();
/**
* @type {import('react').Ref<HTMLIFrameElement>}
Expand Down Expand Up @@ -109,7 +110,7 @@ function DemoFrame(props) {

DemoFrame.propTypes = {
children: PropTypes.node.isRequired,
title: PropTypes.string.isRequired,
name: PropTypes.string.isRequired,
};

/**
Expand All @@ -119,7 +120,7 @@ DemoFrame.propTypes = {
function DemoSandboxed(props) {
const { component: Component, iframe, name, onResetDemoClick, ...other } = props;
const Sandbox = iframe ? DemoFrame : React.Fragment;
const sandboxProps = iframe ? { title: `${name} demo`, ...other } : {};
const sandboxProps = iframe ? { name, ...other } : {};

const t = useTranslate();

Expand Down

0 comments on commit 797048d

Please sign in to comment.