react-fittext icon indicating copy to clipboard operation
react-fittext copied to clipboard

Accept PR of refactor to TypeScript + Hooks?

Open Losses opened this issue 5 years ago • 3 comments

For the concern of compatibility, I refactored the code of this package to the fashion of TypeScript + Hooks and removed prop-types, but the API is identical, with some bugfixes, wondering if you would receive this as a pull request, or I have to publish another package.

Losses avatar Jun 12 '20 07:06 Losses

Hey, thanks for this!

I’d be open to it, but I also don’t mind if you decide to publish another package. If you decide to publish your own package ex. @losses/react-fittext as a TypeScript version, I’d be happy to link to that in the README.

I would want to keep the PropTypes, but otherwise am open to those changes. I’m not really using Hooks much personally, but this component is so minimal I don’t mind.

The most notably absent feature from this component is probably described in https://github.com/kennethormandy/react-fittext/issues/4#issuecomment-526401781 so either way, that is a change I’d like to make. That might not factor into your plans either way.

The TypeScript piece—my understanding is that it wouldn’t have any impact for regular JS users, because the toolchain would be there to compile the output, but it would improve things for developers using TypeScript like you. Is that correct?

kennethormandy avatar Jun 13 '20 18:06 kennethormandy

The TypeScript piece—my understanding is that it wouldn’t have any impact for regular JS users, because the toolchain would be there to compile the output, but it would improve things for developers using TypeScript like you. Is that correct?

Yes, you're right. I'll try to find a way to keep PropTypes

Losses avatar Jun 14 '20 02:06 Losses

I would love to see TypeScript support for this library. Any updates on this?

hoonsubin avatar Jul 08 '20 06:07 hoonsubin