Category "reactjs"

ASP.NET Core Web API CORS error on Firefox but okay on Chrome

I have a React and ASP.NET Core 2.2 SPA that has a CORS issue with Firefox but is okay in Chrome and Edge. I've created a little test rig that consists of the A

Error in my react app file - module not found can't resolve

Error: Compiled with problems:X ERROR in ./src/App.js 8:0-63 Module not found: Error: Can't resolve '.src/components/NewsCards/NewsCards.js' in '/Users/admin/

Type 'Dispatch<SetStateAction<any[]>>' is not assignable to type '(values?: string) => void'

I'm very new to typescipt and trying to make a basic pin-input page. Sandbox link for my code . Although it is working, I'm getting this error for onChange func

Dynamically adjust ImageList columns based on screen size?

I've tried using ImageList component instead of Grid as I just need a grid of photos with titles and it seems to be the whole point of ImageList. My issue is th

How to apply createEntityAdapter to createApi slice

I have implemented successfully a redux-toolkit api. Now Im trying to use createEntityAdapter to be able to use the pre-built selector methods. import { creat

material-ui v4.0.1 warning "Expected an element that can hold a ref"

I upgraded to material-ui v4.0.1 and I see that Modals now require a forwarded ref. I'm having some trouble implementing a fix for this using class components a

Ant design - How do i auto close select ("tags" or "multiple" mode) dropdown after each selection?

I'm using ant.design select component ("tags" or "multiple" mode) in a page, i want dropdown to be automatically closes after each selection. Now it remains ope

API Platform / React - uploading file not working

I'm trying to send an image to my API with React using a formData and Axios but my request in my custom controller shows null. When I use PostMan my api accepts

How to change route without re-rendering in Next.js?

I created a filter that when I clicked confirmed button changes url. For example, When I clicked page 1 and place type guesthouse in paris, url looks like this

How to test CSS properties defined inside a class with react testing library

I am trying to test CSS properties that i have defined inside a class in css, wing the react testing library. However I am unable to do so. Adding the simplifie

Is there a way to overcome 401 unauthorized error in React, while trying to access data from Rapidapi.com?

I am facing the problem of unauthorized 401. Done everything mentally possible, so posting it here with code and result pics. The data when accessed like this r

React Router works only after refreshing the page

I am a bit new to react and I am facing a problem with the Router. The routing works when I enter the URL directly on the browser, however when I click on the l

Suprisingly can't find a solution to this. react-csv automatically download to server instead of user choice

so I'm generating an invoice, and am using the react-csv package to covert my graphql data into a csv file. problem is I don't want the user to select a locatio

FontAwesome spinner won't spin in React

I created a React application with npx create-react-app. Then following these instructions https://fontawesome.com/how-to-use/on-the-web/using-with/react I inst

Any possible way for export two ag-grids data to a single excel file?

I have two ag-grids one beneath the other in the same page. Using the ag-grid export option, I can export them separately. But I am looking for any possible way

useswr crashes react component

After adding an SWR data fetch to my react component it crashes, if I comment it out it works fine. I get the following error after uncommenting line const { da

My markers are not displayed React leaflet

the goal is to displayed marker on map. I don't understand why my markers are not displayed I use react-leaflet The response is okay but nothing is displayed th

userEvent in React Testing Library Doesn't Cause onClick To Be Called

I'm trying to run a really simple test with react-testing-library where a button is given a mock function, the button is clicked, and the test checks that the f

stripejs autofill does not work on chrome mobile device (samsung galaxy)

I'm using <CardElement> and "@stripe/react-stripe-js": "^1.4.1", "@stripe/stripe-js": "^1.17.1", Only seeing this issue on chrome mobile browser

React Native - TypeError: n.createContext is not a function. (In 'n.createContext(o.default)', 'n.createContext' is undefined)

I'm trying to implement React Native into an existing Android application. I follow the steps in the official documentation and I have ended with the following