diff options
Diffstat (limited to 'src/utils/hooks/use-styles.tsx')
| -rw-r--r-- | src/utils/hooks/use-styles.tsx | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/utils/hooks/use-styles.tsx b/src/utils/hooks/use-styles.tsx deleted file mode 100644 index a70087b..0000000 --- a/src/utils/hooks/use-styles.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import { RefObject, useEffect } from 'react'; - -export type UseStylesProps = { - /** - * A property name or a CSS variable. - */ - property: string; - /** - * The styles. - */ - styles: string; - /** - * A targeted element reference. - */ - target: RefObject<HTMLElement>; -}; - -/** - * Add styles to an element using a React reference. - * - * @param {UseStylesProps} props - An object with property, styles and target. - */ -export const useStyles = ({ property, styles, target }: UseStylesProps) => { - useEffect(() => { - if (target.current) target.current.style.setProperty(property, styles); - }, [property, styles, target]); -}; |
