vinpac / windstitch

Windstitch is a 1.4kB, Simple Styling Library that helps you set when a className should be applied to a component.
https://windstitch.vercel.app
MIT License
255 stars 6 forks source link

fix: fixing with Infer in the docs #16

Closed enyelsequeira closed 1 year ago

enyelsequeira commented 1 year ago

Changelog

I think the docs have a typo, however if this is a mistake please disregard my pull request

in the docs it show the usage of infer like this

const ButtonSSS = w.button('text-sm', {
  variants: {
    color: {
      red: 'bg-red-500',
      blue: 'bg-blue-200',
    },
    size: {
      small: 'px-2 py-1',
      large: 'px-4 py-2',
    },
  },
});
type ButtonPropssss = W.infer<typeof ButtonSSS>;

however this will result in TS error, saying that infer is not found, however when you. change it to this type ButtonPropssss = W.Infer<typeof ButtonSSS>;

works correctly, and not TS error. Once again if this a mistake from my side, please do ignore my pull request

Cheers, Enyel

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
windstitch ✅ Ready (Inspect) Visit Preview Nov 30, 2022 at 6:42PM (UTC)