I've been trying to incorporate the forwardRef in my code, but I'm facing some difficulties. Can anyone help me out with this? I'm encountering the following errors:
Property 'forwardedRef' does not exist on type '{}'.
Type '{ forwardedRef: MutableRefObject; }' is not assignable to type 'IntrinsicAttributes'. Property 'forwardedRef' does not exist on type 'IntrinsicAttributes'.
import type { NextPage } from "next";
import dynamic from "next/dynamic";
import { useRef } from "react";
import "react-quill/dist/quill.snow.css";
const ReactQuill = dynamic(
async () => {
const { default: RQ } = await import("react-quill");
return ({ forwardedRef, ...props }) => <RQ ref={forwardedRef} {...props} />;
},
{
ssr: false,
}
);
const Home: NextPage = () => {
const quillRef = useRef(null);
return <ReactQuill forwardedRef={quillRef} />;
};
export default Home;