question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to access Editor instance with dynamically imported react-quill in NextJS

See original GitHub issue

I’m using react-quill in a NextJS app. I’m looking to extend a part of the app where I want to force users to use the Quill instance with a specific formatting option enabled by default (list). To achieve this, I believe I need access to the Quill Editor instance.

However, when attempting to use a ref, I’m unable to call the getEditor method on the ref. The only method available is retry.

I’ve made a CodeSandbox: https://codesandbox.io/s/nextjs-dynamic-react-quill-ref-example-sxm64 Check the browser console to see what the ref object is.

Expected behavior: I would expect the ref to contain a getEditor method

Actual behavior: The ref only contains a retry method

Version: 2.0.0-beta.2

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:8
  • Comments:6

github_iconTop GitHub Comments

38reactions
kt3kcommented, Oct 28, 2020

When next/dynamic wraps the component, it doesn’t seem forwarding ref to the internal component. If I wrapped ReactQuill component with ref renamed to forwardedRef, it seemed working.

https://codesandbox.io/s/nextjs-dynamic-react-quill-ref-example-forked-gyhz3

4reactions
jularbscommented, Sep 16, 2020

have you found a solution for this. I am also experiencing this issue as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to access Editor instance in dynamically imported ...
Unable to access Editor instance in dynamically imported react-quill in NextJS.
Read more >
How to access ReactQuill Ref when using dynamic import in ...
I'm using NextJS for its server-side rendering capabilities and am using ReactQuill as my rich-text editor. To get around ReactQuill's tie to ...
Read more >
ReactQuill with NextJS - DEV Community ‍ ‍
Couldn't find any but I found a way to get ReactQuill working. Import dynamic. import dynamic from 'next/dynamic'.
Read more >
react-hydration-error - Next.js
An example of this is using window in a component's rendering. ... is only executed in the browser and is executed during hydration...
Read more >
Infinite Loading React-Quill With Nextjs Dynamic Import
Unable to access Editor instance with dynamically imported reactquill in NextJS #642. Closed. sanderfish opened this issue on Aug 4.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found