https://github.com/timonvs/preact-reakit-typescript-issue
https://github.com/timonvs/preact-reakit-typescript-issue
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/timonvs/preact-reakit-typescript-issue
- Owner: TimonVS
- Created: 2020-09-29T18:34:02.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-29T18:45:41.000Z (over 5 years ago)
- Last Synced: 2025-03-24T11:49:04.625Z (10 months ago)
- Language: TypeScript
- Size: 72.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Preact Reakit TypeScript issue
Preact and Reakit are both awesome libraries, I'd like to be able to use them both, with TypeScript. The issue I'm running into is that Reakit components (e.g. `Checkbox`) fail to typecheck when using the `as` prop. I believe this happens because the `as` prop is typed for React which causes some incompatibility with Preact. I've "solved" the issue by patching the `PropsWithAs` type from `reakit-utils`. I'm wondering what library authors are ought to do to fix this problem, because adding types for Preact doesn't seem very sustainable 🤔.
Take a look at `./src/app.tsx` to see the issue in action. Run `npm run patch-package` to apply the "fix" to `reakit-utils`, which makes things typecheck properly.