react-css-hooks
This hook works like useState but uses CSS variables for storing.
Install
yarn add react-css-hooksnpm install react-css-hooks
Usage (useDataState)
;; const formDataRef = ;const data = name: "Hasan Ali" age: "27" ; const name: name setName age: age setAge = ; ;;
Usage (useMediaQuery)
;; const breakpoint onScreen = ; if // The screen size is between xl and lg // Current breakpoint (xs, sm, md, lg, xl)console;
Usage (useSelectorState)
;; const cssVars = color: "--color" // The value of the variable comes from CSS bg: key: "--background-color" value: "red" ; const bg: bg setBg color: color setColor = ; ;;