persona-community-5/.pnpm-store/v3/files/3c/03fba70c73c2935d942a20537b2df43b6f360e22c0b9d36fc50067497bfce969aab86d2628142f9f925b1c67c8edb1e4d5c8f8206b38003976b3ecc034fae0
rdev-worker a1d0d1bf1c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature community-ui --requirements 'Build the React commu...
2026-02-24 08:22:30 +00:00

23 lines
630 B
Plaintext

import * as React from 'react';
import { stylesheetSingleton } from './singleton';
/**
* creates a hook to control style singleton
* @see {@link styleSingleton} for a safer component version
* @example
* ```tsx
* const useStyle = styleHookSingleton();
* ///
* useStyle('body { overflow: hidden}');
*/
export var styleHookSingleton = function () {
var sheet = stylesheetSingleton();
return function (styles, isDynamic) {
React.useEffect(function () {
sheet.add(styles);
return function () {
sheet.remove();
};
}, [styles && isDynamic]);
};
};