mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
10 lines
316 B
TypeScript
10 lines
316 B
TypeScript
import React from 'react';
|
|
|
|
export default function ScratchpadSidebar({ name }) {
|
|
const Component = window.Hydro.scratchpad?.[name];
|
|
const [state, setState] = React.useState(0);
|
|
if (Component) return <Component />;
|
|
setTimeout(() => setState(state + 1), 1000);
|
|
return <div>No registered providers.</div>;
|
|
}
|