Category "reactjs"

Environment variable undefined error in node.js

server.js const express = require('express'); const dotenv = require('dotenv'); const error = require('./middleware/errorMiddlewareHandler'); const usersRo

Updating an object with setState in React

Is it at all possible to update object's properties with setState? Something like: this.state = { jasper: { name: 'jasper', age: 28 }, } I have tried:

How to test for document being undefined with RTL?

I have the following react hook which brings focus to a given ref and on unmount returns the focus to the previously focused element. export default function u

Curved view shape in React Native

I wanna replicate the following layout, where there are 2 views (one with white background and the other one with a blue background). The issue is, I can't rep

How to set a default value in react-select

I have an issue using react-select. I use redux form and I've made my react-select component compatible with redux form. Here is the code: const MySelect = pro

REACT - Express : fetching data doesn't work on reload when user connected

I've deploy my first app using React with Nodejs/Express/MongoDB but I'm running through a bug I couldn't find any solution, so I'm coming here to find some hel

In React Login component Firebase Login signup is working but when I am trying to send a reset password Link then is Not sending to email

In React Login component Firebase login signup is working but when I am trying to send a reset password Link then it is not working. there is no getting email v

Types of parameters 'event' and 'event' are incompatible

I have a project, which is an employee monitoring project, and it has several components, and among these components is having a group of buttons together. I ha

React-toastify toasts don't close

I have a react app and I use react-toastify to prompt for certain messages. However, whenever I click the x on the toasts they don't close. They do, however, cl

React Router v4 routes not working

I am relatively new to reacts and I'm trying to figure out how to get React router to work. I've got a super simple test app that looks like this: import React

Jest: "Directory in the roots[0] option was not found"

I am trying to set up monorepo to run all of its Jest tests at once. In each package, I'm using react-app-rewired to get Babel to transpile code imported from o

ESLint - Component should be written as a pure function (react prefer/stateless function)

ESLint is giving me this error on a react project. Component should be written as a pure function (react prefer/stateless function) It points to the first lin

How can I align vertically and horizontally my fields for each column?

How do I align my columns horizontally and vertically aligned in each column? Here the picture (whatI have/whatI want): export default function App() {

Error 404 when you refresh a Next.js page

I am getting this error whenever I try to refresh a routed page in my small Next.js app.

Whats the best way to update an object in an array in ReactJS?

If you have an array as part of your state, and that array contains objects, whats an easy way to update the state with a change to one of those objects? Examp

Pagination in React/Typescript

So I am trying to achieve pagination functionality. Here I have crypto API and a table where data lies, the thing I want to achieve is displaying 10 items per

React-Bootstrap not working after npm installing and importing it

I made an app using create-react-app and then I ran npm install react-bootstrap and then npm install bootstrap Then in my main src/index.js file, I imported Boo

testing fastapi response to next.js with fetch, promise stuck in pending?

my fetch is stuck in pending when I query a fastapi endpoint in local dev. followed this blog and a few others - https://damaris-goebel.medium.com/promise-pendi

TypeError: props.onSaveExpenseData is not a function

I am leaning how to send data from child to parent component in React Why I received this error: TypeError: props.onSaveExpenseData is not a function Please hel

Docker is not accepting proxy api server

i get the following error, when doing a docker-compose up. The app is running but cannot make any api post/get requests. The express server is using port 5000.