Files
SnowLuma/.pnpm-store/v11/files/ab/5a460954998f362a37930770503a3e949c2ad5e7fa75b33f97086deae530be247e11035b4ac38cd5814e75a2a624c6d0fda0b0e1dcf605b1204005e9687aef
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

16 lines
559 B
Plaintext

import { styleHookSingleton } from './hook';
/**
* create a Component to add styles on demand
* - styles are added when first instance is mounted
* - styles are removed when the last instance is unmounted
* - changing styles in runtime does nothing unless dynamic is set. But with multiple components that can lead to the undefined behavior
*/
export const styleSingleton = () => {
const useStyle = styleHookSingleton();
const Sheet = ({ styles, dynamic }) => {
useStyle(styles, dynamic);
return null;
};
return Sheet;
};