Category "reactjs"

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

Is it possible to delay Fade's transition?

Goal: I want Fade's transition to happen after a certain time has passed (ex: 4000 milliseconds). Here is a fragment of my code: <Fade in timeout={{ enter:

Semantic UI React - Table - Make whole row selectable and link somewhere

I have tried making a row selectable but I want to be able to click anywhere inside the row and have it link somewhere. Each row should have a different link.

Camera Preview in Expo is Distorted

I'm using Camera that comes from expo package and I'm having trouble with camera preview distortion. The preview makes images appear wider in landscape view and