Category "reactjs"

Radio button validation not disappear when select a button using Formik and Yup

I am working to handle a signup form with next js, I used Formik from form and Yup for validation, all things are working correctly except radio buttons. The er

React.js: How to get and show current user when logged in?

In my React app I am working in user login. My goal is to show current user's username when the user is logged in. I'm fetching the user data in redux actions a

React.js: How to get and show current user when logged in?

In my React app I am working in user login. My goal is to show current user's username when the user is logged in. I'm fetching the user data in redux actions a

React - TypeError: Cannot read properties of undefined (reading 'params')

So I'm having an error message - TypeError: Cannot read properties of undefined (reading 'params') TypeError: Cannot read properties of undefined (reading 'para

React - TypeError: Cannot read properties of undefined (reading 'params')

So I'm having an error message - TypeError: Cannot read properties of undefined (reading 'params') TypeError: Cannot read properties of undefined (reading 'para

Optimistic updates for item create in RTK Query

Can't figure out how to get optimistic updates to work properly when I'm creating a new item rather than updating the existing one. The optimistic updates do wo

How to map one image at a time with Alice carousel?

I am trying to add a carousel for my products. I have an array of url images in product.images that i want to show individually in the carousel but when i map t

Next JS: getServerSideProps cant get cookie [duplicate]

I want to return two cookies, but only one is returned only token cookie, while key cookie cannot be used export async function getServerSideP

'sh' is not recognized as an internal or external command

Creating a new React app in E:\rn-starter\my-app. Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts with

Hide or show div element

I would like to find out how you can hide and show div element in react typescript. This is the code that I have so far. Any feedbacks function GetUserInfo (use

Why React state in localStorage is being deleted

I'm having problems to persist the state in the local storage. It's a simple todo app. After adding one todo and refreshing it, all todos are being deleted. Cou

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