preactjs / preact-compat

ATTENTION: The React compatibility layer for Preact has moved to the main preact repo.
http://npm.im/preact-compat
MIT License
950 stars 148 forks source link

Add (incomplete) TypeScript declaration #516

Closed jokester closed 4 years ago

jokester commented 5 years ago

I wrote this when updating my CRA + preact + TypeScript boilerplate. Same idea as in #357 , plus a few new names added by preact-compat that I needed.

Hope this can be a start of (often tricky) TS support :shamrock: . Any ideas are welcome.

This declaration should allow people to import React / ReactDOM from 'preact-compat';, but was created with no webpack-aliasing and tsc-aliasing in mind. I'm particularly open to tests / changes that help to be compatible with them.

jokester commented 5 years ago

A minimum test with CRA: https://github.com/jokester/typescript-boilerplate/commit/3301e1795bff3675104b17c528f0de252dae6cca

jokester commented 5 years ago

Hello there. Not sure how PR is done commonly but, can I have some review on this? @developit

developit commented 5 years ago

@jokester sorry for the long review time - this seems odd to me, though: most folks just use the React tsd for preact-compat, since the API's are the same. Thoughts?

jokester commented 4 years ago

Thanks for the reply. I'm totally ok to close this.