Category "reactjs"

how to fix 404 not found error nginx on docker?

I'm trying to make docker file run in to react app.react app all ready successfully deploy but page reload get an error 404 nginx error. this is my docker file

TypeError: _API.default is not a constructor with Jest tests

I have an API class that I am trying to use in a React app. // API file class API { ... } export default API; // Other file import API from "utils/API"; con

Creating a centered carousel with react-alice-carousel

I have struggled the whole day to create a centered carousel with react-alice-carousel library and the results are those. Link to the library here Basically I a

What are the difference between useInfiniteQuery vs QueryClientProvider usage in React Query?

So I've encountered a confusion on the preferable usage of QueryClientProvider and useInfiniteQuery. I've been using the useInfiniteQuery function as a global s

"Module not found" when migrating to Webpack 5

I am trying to migrate my React app to webpack 5.72.0 (from 4.42.1). So I also have webpack-cli (4.9.2), webpack-dev-server (4.8.1) and babel (7.17.9). My probl

TS2322: Type 'Count' is not assignable to type 'ReactNode'

I am new in react and TS and I need help I am trying to use useState with typescript import React,{useState} from 'react' interface Count{ count: number } co

How to access one function from one react component to another

Hi I want that when someone click on backproject I want to set my modal component display to block currently its set to none but when I add that function in App

How to Format code in vs studio with eslint

Initially I used to use prettier to format my React js code. Now I have ESLint integrated with CI that's why my code is throwing minor error of indentation,semi

MUI Datagrid - TypeError: Cannot read properties of undefined (reading 'name')

Im using Material UI's datagrid to show some data in a table, I recently switched over to RTK query from redux for caching and to get rid of the global state ma

Link tag in React is not working with devserver-proxy

I'm following this tutorial to make my React app (localhost:3000) communicate with Node server (localhost:5000) .. so instead of typing <Link to='localhost:5

Modify values of selected option ANTD

I want to choose "% Percent" as option, but the value on the select label want to be only "%", if I set value attribute, it doesn't change when select other opt

On-the-fly thumbnails in React

I am developing a website with React which has what we called "snippets", basically a modal window displaying some kind of media (audios, videos, slides, text q

What is the valid name of the contact?

I'm trying to give a name to my smart contract. But All given names is invalid. Where is the mistake? Because I guess all names are alpha-numeric. Can you help

is usContext a reliable solution to drill state 2-3 level deep

I have a search component which needs to pass the state in which the visibility of my search modal is stored down 2-3 levels. I know that context is provided to

MUI Datatables Column Header Not Tidy

I was using MUI-Datatables in 2020, and I really satisfied with it so I want to use it again with my upcoming project. Lately, Material UI was upgrading and I t

React Spring UseTransition list not removing in order

I have been trying to animate a list of items in React JS using React Spring that changes with new data, but ran into an issue. The problem is, that after chang

How to fix loading spinner when using useEffect Hooks with dependency list?

I am facing one problem when trying to add a spinner. My problem is when I add "product" dependency in useEffect hooks then my loading spinner always spinning a

Module not found: Error: Can't resolve the typescript file when adding typescript to a CRA app

I'm trying to add typescript to my project and write new components with typescript. I followed the documentation but I'm got this error:can't resolve [the type

Web3: Cannot read properties of null after new ethers.Contract

I am trying to use a smart contract just after I instantiate it. However, I get an error: Uncaught (in promise) TypeError: Cannot read properties of null (read

How do I get useEffect to run on array sort? [duplicate]

I have an object like this const example = [{medicineName : "Some name" medicineId : 1} {medicineName : "Some other name" medicine