zenoamaro / react-quill

A Quill component for React.
https://zenoamaro.github.io/react-quill
MIT License
6.78k stars 923 forks source link

I started rewriting using hooks and React 17 compatible APIs #547

Open adrianhelvik opened 5 years ago

adrianhelvik commented 5 years ago

Hi there!

I have started a rewrite of the library. I'm using it in production and it works really well for me. There are some API differences and it has not yet been written to allow full access to the Quill API.

Feel free to reuse the code in the upcoming refactor!

https://github.com/adrianhelvik/react-quill

alexkrolick commented 5 years ago

Thanks, feel free to make a PR. Some API differences are expected as it will necessarily be a breaking change (major version bump).

zenoamaro commented 4 years ago

Thanks for the contribution! We recently completed a TypeScript port of the library, but the codebase did not drastically diverge.

Do you have something you would recommend for inclusion? Eg. code or documentation about Katex?

Cheers

adrianhelvik commented 4 years ago

Hi! That 's great news.

I think polling window.katex works well with async CDN script tags.

Otherwise there is a bug with useQuillValueSync when the value is html. This will trigger onChange immediately with the quill delta.

I used a clone of the source in our product to simplify changes, so the fix for this is not in the repo I linked to.

What I did was essentially to create a new Quill instance on a dummy div, paste the html there and used its delta to set the contents of the original quill instance.

I also had some issues with pasted text containing colors. Also fixed in our product's version with a disallowColors option.

I'll try to find the time to update the public version. In the mean time, I'll be here if there's anything else.

adrianhelvik commented 4 years ago

Another bug I know of in my repo is that when no placeholder is provided, it says "undefined". Also fixed in the private version.