#Hey guys does anyone knows why this error happening

26 messages · Page 1 of 1 (latest)

heady wharf
#

im sure it's something related to the code here,
the useEffect is about transforming some richText to detail and summary then removing it

hybrid hare
#

document.querySelector(".ql-editor") might be returning null. also i'm not sure if you need to use document.querySelector at all for the things you're trying to do

heady wharf
#

quix-fix

#

oh but still an error

hybrid hare
#

yeah ideally you should handle the type errors rather than ignoring them with a comment

heady wharf
hybrid hare
#

remove the comments first. also maybe you should install the eslint plugin in your vscode so you can see the errors

#

do you see red scribbles in your editor i'm not sure if vscode supports ts out of the box

heady wharf
#

this ?

hybrid hare
#

yes

heady wharf
#

i have it already

#

first it takes this

hybrid hare
#

then i'm not sure why the errors arent showing up in your vscode i'm not really familiar with it

#

remove .children

#

or at least check if the queryselector is returning null or not

heady wharf
#

lemme try

#

oh

heady wharf
hybrid hare
#

i mean if you're using react then i don't think you'll ever need document.querySelector

#

if you need a reference to a dom element you could use useRef

heady wharf
#

i think it would be possible only if i had an element

hybrid hare
#

if you're getting data from the database you can fetch it, change the state with useState and render the text based on that state