That's because "model.current" was coming as null for some reason and hence we were seeing error in the console. So I added a condition to check "modalRef.current" is not null then only we will check "modalRef.current.contains(e.target)" to resolve the error. But now I checked the error does not come now and it works without this "modelRef.current" as well.
i liked your tutorial and teaching method ,try to make beginner to advance project so we can make project for our portfolio and make all react hooks with its usecase and where to use it
This is one of the best online React tutorials I've ever used. Thanks for making this!
Excellent. Thanks for this
Thank you. Good tutorial
Could you do this in typescript?
why u add model .current ref in middle of if condition to remove error
That's because "model.current" was coming as null for some reason and hence we were seeing error in the console.
So I added a condition to check "modalRef.current" is not null then only we will check "modalRef.current.contains(e.target)" to resolve the error.
But now I checked the error does not come now and it works without this "modelRef.current" as well.
i liked your tutorial and teaching method ,try to make beginner to advance project so we can make project for our portfolio and make all react hooks with its usecase and where to use it