Category "reactjs"

What dependencies should be in to devDependencies in React on production

I'm having a problem with the size of node_modules so I'm trying to reduce it as much as possible so my solution right now is to put unused depencies on product

React "useRef": no access to method in .current

So in my React Native application, I want to integrate this slider, following the guidance here. Problem is, I want to get access to the method setLowValue()

Firebase error - call Firebase App.initializeApp() -

I have problem with firebase in react. It shows "Uncaught FirebaseError: Firebase: No Firebase App '[DEFAULT]' has been created - call Firebase App.initializeAp

How to use the increment operator in React

Why when I am doing this.setState({count:this.state.count*2}) it is working, but when I am doing: this.setState({count:this.state.count++}) it is not working?

How to conditionally apply CSS classes in React JS

I've been musing on how best to conditionally apply a CSS class in React JS. I've seen some answers banding around but there aren't many out there or they're ju

How to conditionally apply CSS classes in React JS

I've been musing on how best to conditionally apply a CSS class in React JS. I've seen some answers banding around but there aren't many out there or they're ju

Jest matcher to match any one of three values

I have this selector in my component whose default state is '' (empty) string but when change event is fired user can select any one of the three values that is

Prevent rerender react array of objects

I have an Ul component which contains an array of objects with different values in it. Each item called TestCase in this list has a button which makes a restcal

Alternative for Prompt in React Router V6

What is the alternative for Prompt in React Router V6, has it been deprecated, and also hooks like usePrompt, useBlocker are also not available. <Prompt mess

mock function error in react-testing-library

Hii Everyone I am new to react testing ,I am trying to do some example for practise , I am getting a Error,Need your help , this is my App Component const[fi

API resolved without sending a response in Nextjs

I have to make same changes in my nextjs project because my enpoint API doesn't support many calls and I would like to make a refresh from the original data eve

Change color of Select component's border and arrow icon Material UI

I'm trying to use a Material UI Select component on a dark background: But I'm unable to change the color of the drop down icon and underline border to white

formData.append() is not sending file to the server?

I am writing some React.js that will upload multiple photos at a time. I am currently trying to send a batch of photos to the server but I cannot seem to get th

How to select parent components variant in styled components?

In styled-components we can add contextual styles using component selector pattern. But how do we select specific parents variants to contextually style the chi

React Hooks: useEffect() is called twice even if an empty array is used as an argument

I am new to reactJS and am writing code so that before the data is loaded from DB, it will show loading message, and then after it is loaded, render components

react-quill How to properly add attribute to a specific html tag

Here is what I want to achieve. My user is typing a text in a react-quill component and each time the user type a hashtag like "#S1 " (the space is importa

Can i use my own sign in form for aws cognito?

I have a nextjs app that use aws cognito for auth. i was wondering if there is a way to replace the hosted ui provided by aws with my own custom form. import {

Firebase App named '[DEFAULT]' already exists REACT

I'm a beginner in React and at the moment I try to connect my first app to a Firebase database. I have two files for that. The first, is a config.js file wher

yAxes not re-render new data in Chart.js with React.js

Hi I try using the Line chart in my project but get an error you can see it in the image below package.json "dependencies": { "chart.js": "^3.7.1", "react":

Material-table with MUI full screen dialog

Problem: Clicking a button in my material-table it opens the full screen dialog then closing the dialog, Then I am not able to click anywhere in the screen anym