Category "reactjs"

React-router-dom Prompt: Iframe within a page gets unloaded/loaded [closed]

I am working on a react spa to show alert on unsaved form changes. I am using [email protected] Prompt Component for this use-case. The p

Having trouble displaying values retrieved from multiple APIs to Ag-Grid rows (React)

I'm having trouble with this issue for the past couple of days and I've tried somethings but they haven't been working. I'm trying to display some stock informa

MUI: The `styles` argument provided is invalid after upgrading from material v4 to v5

I recently upgraded from Material V4 to V5 and I'm now getting the following error: MUI: The `styles` argument provided is invalid. You are providing a function

npm install gets the error "must provide string spec"

I try to execute an old react app which is created by myself two years ago. When I try to run the app via "npm install", I've got the following error: npm ERR!

Collapse/expand targeted section bootstrap not working

My goal is to toggle a specific section to expand or collapse a list of numbers. I am using Bootstrap for a toggle button to control this section, but it isn't

Heroku application crashed: at=error code=H10 desc=“App crashed” method=GET path=“/”

*I have been trying to upload my MERN app to Heroku and have been getting these error codes. The web application will run on my local host but the application i

Customize code folding for .js and .jsx files in vscode to achieve folding of className='...'

I am looking to fold the className attribute in my react app, as I am using tailwindcss and thus the classNames get quite long, cluttering my files. I've come a

"ReferenceError: Must call super..." when passing raw JSX arg to super in derived class

Trying to run the following in a React app gives the ReferenceError (below). Why? I'm calling super(). Is the JSX somehow "accessing 'this'"? class Base { con

A blank white screen in the React Navigation. React Native

I have a project on React Native and sometimes when errors occur, the application gets on the wrong route in the React Navigation. Therefore, I get a blank whit

How do you use an SVG inline in React using Parcel 2?

Previously in Parcel v1 you could just use something like the @svgr/parcel-plugin-svgr plugin for Parcel. This would give you the ability to use SVGs inline lik

ReactJs this.setState is not a function

I'm trying to change the value of a this.state.id with an <input> tag value, when I click on a <a> tag as follows: {this.state.json[1].map(i =>

Reactjs build failed attempted import error: 'widget' is not exported

I created a new React project with Typescript and I copy and paste old file from another project which is just .jsx file. This file is importing a class called

Getting an error when trying to deploy a react app to heroku

I'm trying to learn how to deploy a react application to heroku, but I keep getting an error message whenever I do a test run. I've been using the following co

How to intercept back button in a React SPA using function components and React Router v5

I'm working in a SPA in React that doesn't use React Router to create any Routes; I don't need to allow users to navigate to specific pages. (Think multi-page q

React.lazy() vs React Loadable

I was using react-loadable for some time for dynamic imports of my React components. In the recent React release 16.6, the React team has included React.lazy

Fixed Table Header React-Bootstrap-Table-Next

I'm having issues making my table header fixed when scrolling. My React Table: <div className="Rules-Container"> <BootstrapTable striped

Can we use object destructuring for useState() in reactjs hooks?

As from the documentation from Hooks in Reactjs, const [count, setCount] = useState(0); they use array destructuring. Can we use object destructuring in pl

How to paginate Cloud Firestore data with ReactJs

I'm working with Firebase - Cloud Firestore and at the moment I would like to paginate all the records available. I already have a list of records and what is l

get value when updated,outside of formik using useRef()

I'm trying to get the value of an autocomplete field outside of my formik component everytime it changes, and i did something like this: const formRef=useRef<

Use imports with string that comes from localStorage

I need to show/hide different menu based on rights that are send from database and saved in localStorage. Here is the imported menus import tripOrders from './t