Category "reactjs"

problem with passing multiple state with React history.push()

I try to pass more then one arg with history.push(). Something like this: history.push({ pathname: '/sailing-data/', state: {

reduxtoolkit mocking store with typescript

I found this code from redux documentation // test-utils.jsx import React from 'react' import { render as rtlRender } from '@testing-library/react' import { con

How to architecture React event handler

I have a list of items, each of which is represented by a component and supports a couple of actions such as "Like", "Save", I have 2 options: one is to keep th

React WalletSignatureError

I'm trying to use solana wallet adapter in my react app following the setup in https://github.com/solana-labs/wallet-adapter but says: Attempted import error: '

Next.js | How to improve seo when doing dynamic routing with ssr

I am writing dynamic routes code in, like the code below. So my question is, this dynamic routes page is not reflected in google at all. I have dynamically set

React onClick event not firing with express-react-views

I am using express-react-views + NodeJS to make a media platform. My "like button" element is not firing it's onClick event. My relevant code: <h1>{this.s

How to resolve act() in useEffect?

I have a small problem with act() error in react-testing-library. In useEffect I try to call an function that is a promise. Promise returns some data and displa

Why does react-router not works at vercel?

I am trying to publish a serverless web to vercel. I want to use react-router and this works good on my computer but when I deploy it It doesn't works Can someb

react-hooks/exhaustive-deps warning--unclear about course of action

I am getting these lint errors ./components/create-nft/InstagramSelector.js 39:15 Warning: Effect callbacks are synchronous to prevent race conditions. Put the

How to create custom CSS classes using MUI v5 theme?

I am using MUI v5 in my application along with react-d3-tree which renders SVG tree charts. It offers an API to include custom CSS class names in the <path&g

I can't install npm install --save react-tilt

C:\Users\JohnSam\Desktop\React\smartapp>npm install --save react-tilt npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm

How to use react-dropzone with react-hook-form?

How to use react-dropzone with react-hook-form so that the form returns proper file - not just file name?

npm ERR_SOCKET_TIMEOUT error while installing create-react-app

While attempting to install create-react-app I'm getting the below ERR_SOCKET_TIMEOUT error. Creating a new React app in E:\New folder\my-app. Installing packa

Typescript useState: SetState in Child with argument

thx for any help. How can I pass down setState to a child component and use the c argument without a typescript error? Parent: Passing down setState export inte

How to use react-router-dom v6 navigate in class component

I installed react-router-dom v6 and I want to use a class based component, in previous version of react-router-dom v5 this.props.history() worked for redirect p

React scroll with antd tabs (scrollIntoView) working for some tabs only

I'm building a multi tab chat like UI using react and antd, it looks like image below. On the left side you can see multiple tabs showing last names using antd

Access context outside render tree

I have an app in React Native that uses many context. I want to access one of them within a non rendering function e.g. : const DataContext = React.createContex

Teams UI Toolkit - Toolbar, Gauge and Map not found in @fluentui/react-teams

I'm developing a dashboard that will be embed in a Microsoft Teams Tab. Microsoft provides an UI toolkit: package and figma templates (source article). However,

React Background Image Change Animation

I'm working on a weather app with ReactJS, what i'm trying to do is have a slideshow of images for my background, the images will be full screen, fading from on

React Electron App - React Leaftlet Content Security Policy errors

I am currently creating an Electron app in which I would like to use react leaflet's maps functionality. This requires the use of external url's which throws CS