Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React18 #793

Merged
merged 3 commits into from Jun 1, 2022
Merged

React18 #793

merged 3 commits into from Jun 1, 2022

Conversation

g12i
Copy link
Contributor

@g12i g12i commented Apr 28, 2022

Fixes #784

Covers #781

@@ -294,7 +294,6 @@ class ReactQuill extends React.Component<ReactQuillProps, ReactQuillState> {
destroyEditor(): void {
if (!this.editor) return;
this.unhookEditor(this.editor);
delete this.editor;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any negative consequences to doing this that you can tell? Do we leak memory or something?

Copy link
Contributor Author

@g12i g12i Apr 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm,

I did a little experiment there:
image

I'm not deleting this on unmount, yet GC seems to be picking it up:
image

It's a pity Quill doesn't have proper clean up method, I guess the right way would be to call it on unmount.

https://reactjs.org/docs/strict-mode.html#ensuring-reusable-state
reactwg/react-18#18

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think @alexkrolick ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a pity Quill doesn't have proper clean up method, I guess the right way would be to call it on unmount.

Are you suggesting a change here?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@g12i, were you suggesting a change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AndreaEsposit I was suggesting that maybe it would better from React's strict mode point of view, if the Quill had destroy() method. It doesn't. I think this PR should still be merged as is.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexkrolick any thoughts ?

@AndreaEsposit
Copy link

Any updates on this?

@korany-lee
Copy link

I'm also waiting for this to be merged.

@Eigilak
Copy link

Eigilak commented Jun 1, 2022

Same

@alexkrolick alexkrolick merged commit 20274fb into zenoamaro:master Jun 1, 2022
@alexkrolick
Copy link
Collaborator

Ok, thanks for the fix. May take a bit to release to NPM.

@mtraj
Copy link

mtraj commented Jun 6, 2022

Ok, thanks for the fix. May take a bit to release to NPM.

@alexkrolick will there be a new beta release number? currently on npm there is version 2.0.0-beta.4 that has been released 10 months ago.

@AndreaEsposit
Copy link

@mtraj good question. I assume this will come alongside the next beta release (beta.5), right? @alexkrolick

@kemikal
Copy link

kemikal commented Jul 1, 2022

When will this be available through NPM? Still can't install on react 18. Its stopping us from deploying to our host!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

React 18 New Strict Mode behaviour duplicate toolbar
8 participants