Skip to content
Advertisement

Tag: reactjs

how to redirect to home page in react using useHistory Hook

I am trying to redirect signup function to home page in react, using usehistory Hook when i run my code it display such errore :: versions:”react”: “^17.0.2”, “react-router-dom”: “^6.2.1” below is my login code given: Answer useHistory is not available in v6, useNavigate Instead of useHistory, Check here https://reactrouter.com/docs/en/v6/upgrading/v5#use-usenavigate-instead-of-usehistory

Fetching data in react returns “undefined” at first time

I have a function component that I control user login with react. According to the username and password entered in the input, if the value returned from the API is true, it redirects to another page, if false, it stays on the same page. When I press the button when the username and password are correct, the first value is

index.esm2017.js:370 Uncaught (in promise) FirebaseError: Missing or insufficient permissions in ReactJs

Complete error Get https://firestore.googleapis.com/google.firestore.v1.Firestore/Write/channel?database=projects%2Fnetflixclone-001%2Fdatabases%2F(default)&gsessionid=Il1qOZrt3xwI9HsitxL5j4_GdibS-ga9&VER=8&RID=rpc&SID=MgLGFVuM420X7FPF_SYqrg&CI=0&AID=0&TYPE=xmlhttp&zx=fhlml28c0sd1&t=1 net::ERR_FAILED 200 Rules(cloud firestone) seedData Code(data.js) firebase.prod.js class All other pages working fine Answer Your security rules just do not allow anyone to read or write to your database. If your set your rule to true as shown below, it should allow your to write: Now the problem is anyone on the internet can read or

Advertisement