ReactError | Cannot use use null properties useRef - IndianTechnoEra
Latest update Android YouTube

ReactError | Cannot use use null properties useRef

 First of all, look inside your package.json file to make sure every used library is listed either as "dependencies" or devDependencies. If not, install them individually.

ReactError | Cannot use use null properties useRef


In your case, if you are not seeing react-router-dom, open a terminal in the root folder of your project where package.json is, and run:


npm install react-hook-form

If the issue persists, make sure your Node.js version is not superior to the last recommended one. If not, downgrade it, and for that, you could use n package from npm:


# if one of the commands does not pass, you may need to use sudo

npm i -g n

n stable

# delete node_modules and start over

rm -rf node_modules

npm install

Finally, ensure all your components start with a capital letter, HomeScreen and not homeScreen. And change the component property of Route to element if you are using the version 6 of React Router Dom:


<Route path="/" exact element={<HomeScreen/>} />

Post a Comment

Feel free to ask your query...
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.