styled-components / xstyled

A utility-first CSS-in-JS framework built for React. 💅👩‍🎤⚡️
https://xstyled.dev
MIT License
2.27k stars 107 forks source link

useUp & useDown accept number values but don't support them #378

Open AlfonzAlfonz opened 1 year ago

AlfonzAlfonz commented 1 year ago

🐛 Bug Report

Hooks useUp & useDown have following type declaration:

declare const useUp: (key: string | number) => boolean;
declare const useDown: (key: string | number) => boolean;

but calling useUp(1024) always returns false.

To Reproduce

const App = () => {
  const upLg = useUp(1024);

  return <>{upLg ? ">lg" : "<lg"}</>
}

Expected behavior

useUp & useDown should either disallow number values or handle them properly.