diff options
Diffstat (limited to 'src/utils/hooks')
| -rw-r--r-- | src/utils/hooks/index.ts | 1 | ||||
| -rw-r--r-- | src/utils/hooks/use-styles.tsx | 27 |
2 files changed, 0 insertions, 28 deletions
diff --git a/src/utils/hooks/index.ts b/src/utils/hooks/index.ts index f4357f2..47e90f1 100644 --- a/src/utils/hooks/index.ts +++ b/src/utils/hooks/index.ts @@ -20,5 +20,4 @@ export * from './use-route-change'; export * from './use-scroll-position'; export * from './use-settings'; export * from './use-state-change'; -export * from './use-styles'; export * from './use-update-ackee-options'; 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]); -}; |
