Category "reactjs"

Accessing previous state within a useDispatch method

How do I access previous state inside the callback function in react? Because once I access data it is always returning an initial state version, since I use us

How to test a DatePicker component using Jest?

Here is the component to test, its a DatePicker component: import { useState } from 'react'; import { useFormContext } from '../Form'; import Textbox from '../T

How to use same enum in multiple files in Typescript without import

I've been struggling with this now longer than I should and surprisingly, the existing questions (and there are many) don't really help further. My goal is to d

Take function from one file to another (React)

So I'm struggling to pass "polygonNFTs" to another file. I need to find its number to decide give user permission or not. its working in index but not in navbar

Conditional render + add some extra code in React

I'm aware of some of the conditional rendering methods for React components. Some of them can be found here. Using ternary operatiors, if...elses.... But I want

Nginx Reverse Proxy Failure in Docker Container

I am new to Docker and nginx and am in the process of setting up a reverse proxy with nginx for my react web application. I am using Docker to contain the appli

React useCallback() not working as expected

I'm trying to understand useCallback() a bit better by creating a simple React app and playing around with it. I tried wrapping handleClick function in useCallb

React Native update component

I'm pretty new to react-native. When I click the stop sleep or info button I send patch requests to the users.json file to change the status. My JSON file conta

Convert a string to number with parseInt does not work as expected [duplicate]

A quick maybe simple question : We are trying to parse a string into number , the sample number is "1928433000460244141" so when we try to par

Sequelize: find count of 3 level associated model entries

I have a products database structure as follows: Categories > Sub categories > Child categories > Products the respective table names in mySql database

How to test a function inside useEffect with Jest and Enzyme?

I am testing my components using jest and enzyme. I want to load my component when the whole page is loaded so I am using load event inside useEffect, here is m

How to make this CARD/CHART Component with Next.js and Apexchart

I know this questions it's kind of too open, but I'm need some guidelines in how to do something like this... That's a card 200x200 with that information. The

How to reduce the Gap space

in below grid container , there is an image on the left , with a bunch of text on the right , there is a huge gap between the image and the text which tried to

Jest Memory Leak when running test cases on redux connected components

When I run my jest tests, I got the following error , this particularly happens with the redux connected components and forwardRef:true is one parameters of the

Dropdowns and filters not applied with REACT

I'm not able to display my menus (_ids.name) that match my filters from the 2 dropdowns (MyNorm1,...MyNorm6) and (Classification1,...Classification6). For examp

How to draw Genogram relationship tree using ReactJs?

I'm looking for a simple Javascript Library (SVG) for the ReactJs module that allows me to draw family tree relationships. I've already referred GoJs Genogram.

Trying to send props value once only in react JS

I have make a slider using carousel at Trip.js and in Home.Js I have created a review section by my self using useEffect and Everytime the slide changes it retu

SignalR TypeError: Failed to fetch after deploying to Azure

I am trying to create a small chat app using SignalR. In my backend I am using .net Core 5 and in Frontend, I am using React. When running in localhost every th

Refresh recoil atom with async fetch, after it has been updated locally?

I have an application where I show a set of invites, each invite has a set of answers connected, that the users can update, I have the following recoil state: e

Why babel alias did not work when set up was all correct?

1.I'm building a react project and try to use Babel to simplified the import. Here is the code for babel.config.js file. module.exports = { presets: ['modul