Yamada UIにスターをあげる

スター
Yamada UIYamada UIv1.5.1

useBreakpointState

useBreakpointStateは、提供されたオブジェクトから現在のブレイクポイントを初期値として返すカスタムフックです。

ソース@yamada-ui/use-breakpoint

インポート

import { useBreakpointState } from "@yamada-ui/react"
Copied!

使い方

編集可能な例

const [value, setValue] = useBreakpointState({
  base: 1,
  md: 2,
  sm: 3,
})

return (
  <Button onClick={() => setValue((prev) => prev + 1)}>
    The current value is "{value}"
  </Button>
)
Copied!

GitHubでこのページを編集する

useBreakpointEffectuseBreakpointValue