Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Typescript: definitions overhaul and parity with React #639
Current state of preact type definitions is not in very good shape and is impossible to use it with any React library.
What needs to be done:
We are using Preact, Skate with Typescript at work ( large enterprise company ), and have to override everything manually, so everything works. With that said I can contribute to this project by setting up everything how it needs to be. Also we relly on Preact in upcoming SkateJS 5, and this is kind of blocker for us.
Hope this makes things clearer.
This was referenced
Apr 11, 2017
Does this issue and the PR #621 also fix following issue? I'm using preact and write my tests with enzyme (thankfully preact-compat-enzyme exists!). Unfortunately I get a lot of these errors as long as I add the
At the moment the only solution that I know is not to add
Cool! I'm really looking forward for this.
One little question:
How do you do that? Is there a TypeScript compiler option that says "ignore the shipped .d.ts file from preact and use my own declarations file instead?" I was always searching for that and didn't find anything. The only thing that I know is simply not to add a
By the way: I wish you a nice and sunny vacation
Yup and TS is again just JS, you can use only those Ecmascript features, which you need
Overall, if Preact wont use typed JS, I very highly recommend using Typescript in the background, because it is capable of checking your code without writing any TypeScript at all. #powerOverwhelming
referenced this issue
Aug 21, 2017
I noticed that Preact and
Repro steps: 1. create empty folder with tsconfig.json:
/** @jsx preact.h */ import * as preact from 'preact'; preact.render( <h1>Hello, world!</h1>, document.getElementById('app') );
But with one more command...
The errors start at line 2239 in
@qwertie No, this is a separate issue, see #1036. The reason they are clashing is that both define the
@theKashey I've created this a while ago, so Preact is usable with Typescript and React packages without issues. You may find it useful https://github.com/Hotell/react-preact-typescript-interop