Skip to content
Advertisement

Tag: reactjs

React how to make conditionally rendered navigation persist

I am in the process of learning React and am creating a React desktop app where the side-navigation must change depending on the user’s current location (determined by standard navgation buttons in the App body). The application is accessible here: https://codesandbox.io/s/conditional-navigation-di8t5?file=/pages/Start.jsx I am able to make the navigation options render conditionally as the user moves through the app. See for

React Hooks – Updating state using props without event handlers

I’m relatively new to React and this is what I’m trying to accomplish: User selects an item from the sidebar. The elementID is lifted up to the parent(app.js). app.js sends it to its child, Graphs. Graphs will create a Graph component and append to its graph array. Is there a better way than this? P.S I’ll have more than 1x

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 logged in, the

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 google, stackoverflow. Many thanks! Answer If you look using

How to call a method once a component is rendered?

I have a parent component that conditionally renders two components. Once I am done entering data in the first component, I click done and then render the second component. I want the second component to only then parse all the data I entered in the first component. Im a little confused which lifecycle method I am supposed to be using.

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 from API:

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 component level (Rules of

Advertisement