Closed mseddon closed 5 years ago
Would be great if this could be merged @developit :+1:
By the way: why did you change the title to DONOTMERGE
@mseddon ? Because of stateless functions? Do you have found a solution for that?
That's the only reason I held off, otherwise this looks good to me (though I know little about TS)
I can confirm that this PR does not work with functional components. I played around a bit with pulling the latest definitions for react-redux, but they're quite complex and I couldn't understand them well enough to adapt them to preact.
Might be worth asking the authors of the react-redux bindings, @tkqubo @seansfkelley - would either of you be able to help get this working? Thanks!
@screendriver yeah, stateless functions was the big one, various attempts to fix it triggered bazillions of errors. I think I'd need a bit more Typescript-fu (and free time!) to get that working. Any help appreciated!
I am not familiar with preact or preact-redux, but compared to the current react-redux typings there are more differences than I would expect. What kinds of errors do you get when you introduce stateless component types? Also, note that Typescript cannot properly express the types of connect when used as a decorator, so watch out for that.
Any updates on this?
This is a pretty cheesy solution. But hey!
Seems to have trouble with stateless functional components, need to parity check the support against react before it's ready, but at least it gives everyone a chance to have a look at what I'm doing.