Skip to content

Commit

Permalink
fix: fix useCssVar
Browse files Browse the repository at this point in the history
  • Loading branch information
vikiboss committed Jun 13, 2024
1 parent ff734a0 commit c7b7e5e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/use-click-outside/demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useClickOutside, useCounter } from '@shined/use'
import { useRef } from 'react'

const cls =
'px-4 size-60px rounded text-white flex items-center justify-center cursor-pointer select-none hover:opacity-80 active:opacity-96 transition'
'px-4 size-60px rounded text-white flex items-center justify-center cursor-pointer select-none hover:opacity-96 active:opacity-80 transition'

export function App() {
const [count, actions] = useCounter(0)
Expand Down
2 changes: 1 addition & 1 deletion src/use-css-var/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function useCssVar<T extends HTMLElement = HTMLElement>(
const { defaultValue = '', observe = false } = options

const [variable, _setVariable] = useSafeState(
ensureSSRSecurity(() => getCssVar(unwrapGettable(propName), defaultValue), defaultValue),
ensureSSRSecurity(() => getCssVar(unwrapGettable(propName), target, defaultValue), defaultValue),
)

const el = useTargetElement<T>(target)
Expand Down

0 comments on commit c7b7e5e

Please sign in to comment.