Category "reactjs"

Apollo reactive variables - how to mock value of the variables into a component during testing

I need some help. I'm a newbie in apollo client reactive variables. There is a component where the displaying of the message depends on a variable that values f

React, typescript: Wrapping text inside table <td> doesn't work

I'd like to wrap the text inside a table cell. I tried "flex-wrap", "break-inside" and similar properties, nothing has worked so far. It has already worked a fe

React Table filtering data fetched from API

I am working with the react-table. Using data from API then storing into the state. I don't have a good idea for filtering data. I have a table with pagination,

React Uncaught ReferenceError: process is not defined

I am getting issues with iframe. Till today everything was working as expected. Today I added a very simple Modal component and somehow iframe started appearing

Module '"react"' has no exported member 'SuspenseList'. TS2305

I'm trying to learn some of the new features in React 18, such as the SuspenseList and new useId hook, but I seem to be getting the same error over and over: Mo

ReactJS API call - Need redirect URL in response from request with 30X status without redirecting

I have an API which returns 30X response and redirects to a specific URL. But, I want to get redirect URL from response without redirection. I am using this in

I have an <Add /> component that is called in two different pages, but only one of them is receiving the add count prop passed to it in React JS

Please help me understand why this logic is not working on one of the instances of my counter button. My goal is to have my counter display the count like this:

Can't include code execution at jsx top level?

For the following code, it will gives exception when include the line {console.log('hello');} import "./styles.css"; export default function App() { const ag

Error: ENOENT: no such file or directory, open

I am learning apollo. When I run my code it showing this error on my browser I don't know if it is my browser's problem. can anyone help me fix this Error messa

Jest unable to recognize SVG component

Jest is raising this error on one of my components: Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/fun

how to know if i should use redux for my application or any other alternative?

I am new to react native and mobile development world. I am developing a mobile application with react native, it's basically an entreprise management app for H

Typescript based React: importScripts() gives: 'importScripts' is not defined no-undef

Following Google Workbox instructions, the first thing I am told I should include in serviceWorker.js is: importScripts('https://storage.googleapis.com/workbox

Problem with scrollIntoView not scrolling until the end on React

I have one component that builds a list of messages for a chat, the scrollIntoView function only works when I open the chat for second time, (the first time, it

Changing DOM while getting result from filter ReactJS

i am working on a search function with states received from input's value , when there is no result i want to change the innerText of my div with an error text

Next.js + Framer Motion scroll progress animation

So I want to create a viewport scroll progress circle with Framer Motion in a Next.js app (using tailwind as CSS). I used the example code from Framer Motion: h

How to change background color in react materialUI card

Hi i want to change background color of card in react materialUI card project. see the attached picture what i am expecting. Screenshot: https://stackblitz

Yarn start not working | error `ERR_PACKAGE_PATH_NOT_EXPORTED'

I have been trying to make this React App, but when I try to do yarn start it shows the following error message: yarn run v1.22.17 $ react-scripts start node:in

React chartjs 2 - Type 'string' is not assignable to type '"timeseries"'

I've been trying to set x-axis as timescale in react-chartjs-2, but can't get past this following error. Chart options code snippet: const options = { plugin

How to change background color in react materialUI card

Hi i want to change background color of card in react materialUI card project. see the attached picture what i am expecting. Screenshot: https://stackblitz

setState inside useEffect doesnt update UI

i am trying to fetch multiple endpoints in UseEffect and depending on it's result show data on the UI (avatar, username, etc.) Problem is, that the data receive