Home > Software design >  Type 'MutableRefObject<HTMLParagraphElement | null>' is not assignable to type '
Type 'MutableRefObject<HTMLParagraphElement | null>' is not assignable to type '

Time:12-01

I am trying to build the app after testing it and this error occurs

enter image description here

I tried multiple methods shown in stack and other documentations but I am not very clear about the problem

Here is my code:

type props = {
  html: React.MutableRefObject<HTMLDivElement>;
  data: any;
  rows: any;
};

CodePudding user response:

It was a minor mistake, I just assigned "html" with type any and the issue was solved.

i.e, html : any;

CodePudding user response:

Make the property support null with HTMLElement

html: React.MutableRefObject<HTMLElement | null>;
  • Related