Category "reactjs"

setupProxy is not working - http-proxy-middleware

My react app is up on localhost:3000 and node server is running on localhost:5000. When I am trying to connect to the express API the route is going to 'localho

I am getting an error of Html Webpack Plugin in reactjs

My Application was working fine but when I installed material ui npm package my application is giving me this error. Html Webpack Plugin: Error: Child comp

Trigger useEffect in Jest and Enzyme testing

I'm using Jest and Enzyme to test a React functional component. MyComponent: export const getGroups = async () => { const data = await fetch(groupApi

Pokemon API request generate 5 Pokémon at a time

I need help with how to fetch 5 random pokemon at a time instead of rendering all pokemon on the screen using react? // destructuring const [items, setItems] =

REACT- Uncaught TypeError: Found non-callable @@iterator

In react, I have a component that takes in 2 destructured parameters. One of them is an array called points. However, when attempting to call the Math.max(...po

Multiple path names for a same component in React Router

I am using the same component for three different routes: <Router> <Route path="/home" component={Home} /> <Route path="/users" componen

React JS - Material UI ListItem (with Collapse API) onClick expands/collapse all sub list items instead of the selected one

I'm implementing Expand/Collapse feature of List using React JS - Material UI ListItem (with Collapse API) When I click on the ListItem it expands/collapse a

How to replace /n to linebreaks in react.js?

I am trying to replace every /n to a <br> tag in ReactJS. In my note.note object there is a string with multiple /n in it. example note.note: test\ntest

React.memo - why is my equality function not being called?

I have a parent component that renders a collection of children based on an array received via props. import React from 'react'; import PropTypes from 'prop-ty

Why "clientSecret is not a recognized parameter" in stripe

Im confused. The Stripe Docs to integrate stripe elements in react said here: const options = { // passing the client secret obtained from the server clientSe

How to use framer motion animation with swiper.js (React)?

So the animations are only occurring during the initial page reload. I want the animations to execute every time I scroll down to another page. How do I use rea

Use reselect selector with parameters

How do I pass additional parameters to combined selectors? I am trying to • Get data • Filter data • Add custom value to my data set / group d

How to specify (optional) default props with TypeScript for stateless, functional React components?

I'm trying to create a stateless React component with optional props and defaultProps in Typescript (for a React Native project). This is trivial with vanilla J

Newbie- API to get Ethereum's latest blocks

I am looking for an ethereum api to get the N latest blocks. I will use javascript (react) to make the requests. I have looked into https://etherscan.io/apis#b

react-router-dom <Routes> and <BrowserRouter> errors

I am using react-router-dom and am facing an issue with using <Routes>: Here is my index.tsx file: import React from 'react'; import ReactDOM from 'react-

how to listen for route change in react-router-dom v6

am trying to migrate the old react router dom code to v6 and I want to know how to listen for route change, I am now using useHistory const history = useHistory

Detect when mobx observable has changed

Is it possible to detect when an observable changes in any way? For instance, say you have this: @observable myObject = [{id: 1, name: 'apples'}, {id: 2, name

How to pass a an argument to getByText in react Testing Library?

Currently I'm doing this getByText(/SomeText/i); But I want to make a function and pass some text as an argument by first storing it in a variable. I tried doi

How to manually trigger click event in ReactJS?

How can I manually trigger a click event in ReactJS? When a user clicks on element1, I want to automatically trigger a click on the input tag. <div classNam

Problem chrome content security policy react extension manifest

I created a very simple extension chrome but I have a problem I can not fix it, the problem is of Content Security Policy of google chrome please I need help fo