Category "reactjs"

How to remove an item from Local Storage when clicking on it? [duplicate]

I want to delete an item stored in Local Storage when it is clicked. But I don't know how to do that. Please help me to solve this problem. Th

State in useEffect undefined after the useEffect sets the state?

I have a React Native app in which I am running some code that looks like the code below. Why is the following output undefined? Reading someState from useEffec

Make id in FormattedMessage from react-intl inherit from a custom TypeScript interface to enable VS IntelliSense and type checking

Given that react-localization does not have date and number format and is heavily dependent on one developer we decided to switch to react-intl because it seems

Unable to fix popper placement in autocomplete

I am using the <Autocomplete /> component of Material-UI and I have a situation where I want my drop-down to always appear at the bottom. Therefore I did

How can I fix : Request header field x-access-token is not allowed by Access-Control-Allow-Headers in preflight response?

I am trying to upload an image to Cloudinary from my local address (localhost:3000). However, when I try upload an image to it, it is giving me this error: Acce

Error 401 on API Platform for some requests

I try to request some information from API Platform with React. This is my code to get all the Technics. It works perfectly fine, I got a status code 200. But w

502 Bad gateway after deploying react app on GCP

I recently upgraded my application from CRA-ts to CRA, upgraded react version from 16 to 17 with typescript version of 4.1 and node version to 16. On backend I

mount is not working in enzyam in react js

//write the test case got this error when i am using shallow its working fine but not gent expect value do you have any solutin please help to me import React f

Vercel 500 internal error! Cannot get logged in

[GET] /auth/signin?callbackUrl=http://localhost:3000 17:22:23:77 2021-10-24T12:22:24.062Z a07d6ace-3b47-4472-a45b-f7ef9989a9b5 ERROR [next-auth][err

how to reveal/unrveal password inside input in Data Driven Forms (it npm react package)?

I have a custom form imported from node_module as import FormRenderer from "@data-driven-forms/react-form-renderer/form-renderer"; this form requires schema in

Can't format Quran page in react native

I am making an app to read Quran, using react native (expo). I am having some problems formatting the text. Problems: Random spacing Text resize automatically T

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in the package.json of a module in node_modules

This is a React web app. When I run npm start This error occurred > [email protected] start > react-scripts start node:internal/modules/cjs/loader:488

Can i put a value inside a ReactJS Component and then get that value somewhere in another file with importing?

so i am making a ReactJS Component for a contact form. And right now I want to make a method that gets the value from an input in the JSX, and then i want to ge

How to fix 'The previous state received by the reducer...'?

I load/update data in localStorage: import thunk from "redux-thunk"; import {applyMiddleware, createStore} from "redux"; import {composeWithDevTools} from "redu

Can't resolve 'otp-input-react' in my D:\project\app\src

I am trying what I am doing is wrong but didn't find any.Tried to uninstall and reinstall the package then also it is not working here are the images for more c

React Material Table : onRowAdd not refreshing

I am using Material Table for displaying table data. Using onRowAdd, I am able to add a new row but the page is not refershing. It reloads and get stuck then I

How to set focus a ref using React-Hook-Form

How do you implement set focus in an input using React-Hook-Form, this is what their FAQ's "How to share ref usage" code here https://www.react-hook-form.com/fa

Concat string with html element in react

This might give a better idea, replace in paragraph, ' ==> " and highlight it for (let i=0; i<orgString.length;i++) { changeVal.push("color:#" + Mat

How to query for image height and width in Gatsby.js?

I want to conditionally render sections of a page, depending on the height and width of the images that go in each section. I source the images from the Content

How to dynamically disable a row's checkbox in react-bootstrap-table2?

I want to achieve something that is in my current sandbox: Currently I've hardcoded the nonSelectable: [1, 2] so it will make row 1 and 2 unselectable. Now I w