Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function HomePlayground() {
const tab = useTabState({ selectedId: "tab" });
const tabPlayground = usePlaygroundState({ code: tabCode });
const dialogPlayground = usePlaygroundState({ code: dialogCode });
const menuPlayground = usePlaygroundState({ code: menuCode });
const submenuPlayground = usePlaygroundState({ code: submenuCode });
const menubarPlayground = usePlaygroundState({ code: menubarCode });
const [modules, setModules] = React.useState>({});
const [clientRendered, setClientRendered] = React.useState(false);
React.useEffect(() => {
requestAnimationFrame(() => setClientRendered(true));
}, []);
React.useEffect(() => {
try {
const obj = {} as Record;
obj["./Tabs"] = compileComponent(tabPlayground.code, obj, "Tabs");
obj["./TabsModal"] = compileComponent(
dialogPlayground.code,
obj,
const { static: isStatic, maxHeight, className } = codeElement.props;
let [, mode] = className.match(/language-(.+)/) || ([] as any[]);
const modeMap = {
html: "htmlmixed",
js: "javascript"
};
if (mode in modeMap) {
mode = modeMap[mode as keyof typeof modeMap];
}
const isDynamic =
!isStatic && ["js", "jsx", "ts", "tsx"].indexOf(mode) !== -1;
const [code] = codeElement.props.children;
const state = usePlaygroundState({ code });
React.useEffect(() => {
state.update(code);
}, [state.update, code]);
if (isDynamic) {
return (
<div>
</div>
export default function HomePlayground() {
const tab = useTabState({ selectedId: "tab" });
const tabPlayground = usePlaygroundState({ code: tabCode });
const dialogPlayground = usePlaygroundState({ code: dialogCode });
const menuPlayground = usePlaygroundState({ code: menuCode });
const submenuPlayground = usePlaygroundState({ code: submenuCode });
const menubarPlayground = usePlaygroundState({ code: menubarCode });
const [modules, setModules] = React.useState>({});
const [clientRendered, setClientRendered] = React.useState(false);
React.useEffect(() => {
requestAnimationFrame(() => setClientRendered(true));
}, []);
React.useEffect(() => {
try {
const obj = {} as Record;
obj["./Tabs"] = compileComponent(tabPlayground.code, obj, "Tabs");
obj["./TabsModal"] = compileComponent(
dialogPlayground.code,
export default function HomePlayground() {
const tab = useTabState({ selectedId: "tab" });
const tabPlayground = usePlaygroundState({ code: tabCode });
const dialogPlayground = usePlaygroundState({ code: dialogCode });
const menuPlayground = usePlaygroundState({ code: menuCode });
const submenuPlayground = usePlaygroundState({ code: submenuCode });
const menubarPlayground = usePlaygroundState({ code: menubarCode });
const [modules, setModules] = React.useState>({});
const [clientRendered, setClientRendered] = React.useState(false);
React.useEffect(() => {
requestAnimationFrame(() => setClientRendered(true));
}, []);
React.useEffect(() => {
try {
const obj = {} as Record;
obj["./Tabs"] = compileComponent(tabPlayground.code, obj, "Tabs");
obj["./TabsModal"] = compileComponent(
dialogPlayground.code,
obj,
"TabsModal"
export default function HomePlayground() {
const tab = useTabState({ selectedId: "tab" });
const tabPlayground = usePlaygroundState({ code: tabCode });
const dialogPlayground = usePlaygroundState({ code: dialogCode });
const menuPlayground = usePlaygroundState({ code: menuCode });
const submenuPlayground = usePlaygroundState({ code: submenuCode });
const menubarPlayground = usePlaygroundState({ code: menubarCode });
const [modules, setModules] = React.useState>({});
const [clientRendered, setClientRendered] = React.useState(false);
React.useEffect(() => {
requestAnimationFrame(() => setClientRendered(true));
}, []);
React.useEffect(() => {
try {
const obj = {} as Record;
obj["./Tabs"] = compileComponent(tabPlayground.code, obj, "Tabs");
obj["./TabsModal"] = compileComponent(
export default function HomePlayground() {
const tab = useTabState({ selectedId: "tab" });
const tabPlayground = usePlaygroundState({ code: tabCode });
const dialogPlayground = usePlaygroundState({ code: dialogCode });
const menuPlayground = usePlaygroundState({ code: menuCode });
const submenuPlayground = usePlaygroundState({ code: submenuCode });
const menubarPlayground = usePlaygroundState({ code: menubarCode });
const [modules, setModules] = React.useState>({});
const [clientRendered, setClientRendered] = React.useState(false);
React.useEffect(() => {
requestAnimationFrame(() => setClientRendered(true));
}, []);
React.useEffect(() => {
try {
const obj = {} as Record;
obj["./Tabs"] = compileComponent(tabPlayground.code, obj, "Tabs");