Category "reactjs"

React Hooks: How can I use a hook to map an array from a dumb component

I have my api call in a React hook, like so: import { getAllTheBakeries } from './bakeries.api'; export const useBakeryList = () => { const [bakeries, set

React js unable to render when using graphql useQuery with parameters

I have already checked my imports and exports and also the graphql query that I have made... I use useState to handle the inputs on both username and password.

React-grid-layout - drag only on first div

I implemented react-grid-layout with two elements. The thing is I have text in the first element and because it is draggable I can't copy the text from it becau

Test onClick of a button is called when there is no props passed down to it using testing library react and jest

I have a component for an upload button which calls the ref of an input when clicked: import { useRef, FC } from 'react'; import Button from '@mui/lab/LoadingBu

using swiper in react js app that created by vite

i'am trying to use swiper js in my react js project that created with vite but it throws and error with this title : Failed to resolve import "swiper/css" from

How to display Mongo data in Front End in MERN

I am working in MERN Stack and i am stuck at a part where i have to display the data of MongoDB compass on the Web page in a designed way i am able to display a

Getting data attribute from root in ReactJs

I'm trying to grab the attribute listed in the div being rendered but it returns undefined. Any idea on how to go about it will be greatly appreciated index.htm

Update one property in MongoDB and update UI without refresh the page

I am trying to update one property Like I have a few properties, product name, price, quantity, supplier, and description. I am sending all the updated quantiti

How to avoid table header duplicates in react bootstrap?

My Table header is repeating. I have loaded some items from the mongodb database. Then I applied map. But it appears for every items new header is repeating its

Routing Inside Routed Components in React

I have an top level App componenet which contains and SideBar and MainBody. Here's my App Component, function App() { return ( <div className="pa

TypeError: (0 , _ethereum_Station__WEBPACK_IMPORTED_MODULE_4__.default) is not a function

I am unable to go ahead due to this error. This is the \stations\show.js file import React, { Component } from "react"; import { Card, Grid, Button } from "sem

Redux store is updated but view is not

I have the parent Posts.js component which map every object in posts array. In this function I try to filter all notes have same post_id as id of the current ma

Attach Access Token in API call Redux

Im sending id ,accessToken as a parameter to my API, they are redux store states, I want to attach my accessToken in my header.Authorization and send it togethe

How to push values into an array on submit btn click (react js)

I have a questions form with custom inputs. const Input = (props) => { return ( <div> <label className={classes.label}>{p

cannot find symbol ViewManagerResolver viewManagerResolver

Unable to build the react-native application because of library react-native-reanimated which is causing the error "cannot find symbol ViewManagerResolver viewM

React app using Cloudflare Pages: error [email protected]: The engine "node" is incompatible with this module

When I deploy a React app using Cloudflare Pages, the Building application step fails with the error: error [email protected]: The engine "node" is incompatib

Deleting cookie in client from server failing (Firefox)

Im trying to delete the cookies in the client that my server created every time the user logout, they have httpOnly:true attr so only the server response can de

React Image gallery issues - return outside the function

Im having issues turning a html and js file into a react component (image gallery). The below is the component and the images are taken from a shop.js file. Whe

map function not working in ReactJs using nexttjs

I am new in ReactJS and i am using "Nextjs" framework,Right now i am using "async" function for fetching data but unable to fetch using "map" function, in conso

Cypress: Not able to stub with a basic example. What might i be missing?

For some reason, I am not able to stub this here. I have reduced my code to almost exactly this here. This should work according to the docs, but I'm wondering