Been banging my ahead against a wall on this one for a while. Doing the FCC course, essentially completed a project but trying to fetch a JSON with an array rather than just putting one in directly, myself, as I wanted to learn how to do it… Didn’t think it would be this difficult! What do I want to do?
Tag: reactjs
Joi validate at least one of 2 input fields are completed
I seem to hit a roadblock when it comes to joi’s .or() function as it doesn’t seem to implement as I’d expect. I have 2 text input fields, both have their own way of validating, though only at least one is required. it just seems that this or doesn’t do as I’d expect and each field from the or is
Why I cannot remove the element of the array of useState hook
This is the code, Please check the function deleting in the filter section I am trying to delete the elemt from the array using setarray. This is the codesandbox link https://codesandbox.io/s/silly-neumann-b0foos?file=/src/App.js:0-1072 Answer e is an object having index as prop… so its e.index
NextJs doesn’t rerun scripts
When I use the <Link> tag in NextJs to navigate between pages it doesn’t rerun my scripts after changing pages. It only runs the scripts after the first page load or when I press reload. When using plain <a> tags instead, it works fine because the page reloads after each navigation. As far as I can tell this happens because
Should I use router.isReady when fetching with react-query?
Been stuck on this issue for some time now trying to retro fit react-query in to my codebase. I have a working version using getStaticProps. I have been experimenting with router.isReady from next/router to try and force the page to wait for the router.query value to be present before passing it as props to the react hook. Here is my
How to pass these array location attribute in to setState and and display the value
I want to access to these array location attributes and How to pass loaction to the setstate and display them inside the return state (react functional component used) Answer since response.data.exsitingSupplierDetails is an Array of length = 1, you can access the location like this: response.data.exsitingSupplierDetails[0].location
How to use the Pagination in Microsoft Graph API
I would like to be able to retrieve all users in my Azure Active Directory and cache it so I could filter my users on demande. I know about the nextLink used for Pagination. I’m fairly new in the React world and Javascript so I need some help understanding how to cycle through all pages to get all my users.
My Image is not rendering in reactjs typescript
I’m creating an app using **reactjs **and **typescript **however I encountered an issue while loading **images **inside a component. My error in console This is my component: NB : The images are stored inside a ‘images’ folder and the project component is stored inside a ‘components’ folder **NB#2 : **the first image ‘pin’ loads normally. Thank you for all the
handleChange function causes dispatch function to return undefined
I’m currently learning about useReducer for react. I’m trying to make a recipe box with ingredients, measurements and amounts that you can change by typing inside the text-input boxes. But whenever I try to do the typing, the entire list disappears, and I get this error Each recipe seems to return “undefined” when I try to change any of the
React router v6, group routes by feature
I am using React router v6. THE PROBLEM: my App.tsx is very big as it includes routes for all of the application: Ex. I would like to group these routes by feature so that I end up having something like this: it would look cleaner and easier to read. So far I have created something like this for the Admin