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

Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.

Open Receiver412 opened this issue 4 years ago • 6 comments

i'm using react-quill with react-hooks .I got this warning

Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.

  • Move data fetching code or side effects to componentDidUpdate.
  • If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state
  • Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run npx react-codemod rename-unsafe-lifecycles in your project source folder.

Please update the following components: Quill

here is my code

import React, { useState } from "react"; import ReactQuill from "react-quill"; import "react-quill/dist/quill.snow.css";

function TextEditor() { const [text, setText] = useState(""); const handleChange = value => setText(value);

return (

  <ReactQuill value={text} onChange={handleChange} />

); } export default TextEditor;

Receiver412 avatar Feb 13 '21 17:02 Receiver412

same issue for me too. Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run npx react-codemod rename-unsafe-lifecycles in your project source folder.

sivadinesh1 avatar Feb 14 '21 05:02 sivadinesh1

The author says it's fixed in the quillv2 beta. https://github.com/zenoamaro/react-quill/issues/564

phuwin avatar Feb 17 '21 08:02 phuwin

In my case, the problem was happen because I'm trying to load a qr code inside the Storybook. So, I created a boolean state to identify when the scenario is a SB and apply a fake qr code (a generated image) and when it's in production, the real qr code will be called. Works great for me.

LucasNeevs avatar Aug 09 '21 11:08 LucasNeevs

I'm using quillv2 beta and still have this problem

saunic avatar Feb 17 '22 19:02 saunic

With the latest version (1.3.5), this appears to still be an issue.

dylan-hepworth avatar May 26 '22 20:05 dylan-hepworth

With the latest version (1.3.5), this appears to still be an issue.

yes, I also faced this warning in stable version, use beta version

moinulmoin avatar May 27 '22 17:05 moinulmoin