Skip to content

Tag: reactjs

Make page only accessible if logged in – React

Hello, please I,m a beginner in react. and I need help in knowing how to approach this challenge in the snippet above, is my homepage. my goal now is to make only explore and tour components to visible when user is logged out. so when the users visit the homepage the components will be displayed but when logg…

Web page components animation

I’m a beginner learning front end development. I’m curious to know and learn how other developers create animated component like the one in below site. https://bzx.network/ Do we have a tool that will let us create this? Where I can learn these? I couldnot find the tool, right search keyword in go…

Value from response is undefined ReactJs

I’m trying to get values from trains such as id and number, but when I try to do that, no values shows. When I try to console.log that I get response of undefined. It works well with station.name and station.city but i does not work with station.trains.is. Here is my code: And here is the response I get…

React Hook “useState” is called in function

I have button click system and it works. Now I want to fetch the API inside the function. So, change the function clickCreate like this However there comes error like this. I should not use useState and useEffect in function, but how can trigger the API by btn click?? Answer You should move the hook to compon…