Category "reactjs"

Scoping v5 MUI Styles

We have a legacy application that we're slowly migrating to React and MUI. In order to prevent overlap in styling between the different parts of our applicatio

How to verify user based on reCAPTCHA user response and secret key in react.js?

When reading the documentation, the following methods of verifying the user are shown: For web users, you can get the user’s response token in one of thre

MUI Datepicker how to disable next month only

I'm using MUI v5 and I want to disable next month only in datepicker. Others are available

Next.js: Select element must have an accessible name: Element has no title attribute

Next.js and Typescript beginner here. I'm rebuilding an app using Next.js but ran into trouble splitting pages and components with the error Select element must

React onclick change variable/state to return different html

I am trying to have html be rendered while x =true, and different html while x = false. I am not sure how to do this in react but I thought of two ways, both wh

How to recover original code file parsed by React build?

I'm working on React old projects and several of them have the native structure, like: ...{ key: "render", value: function () { return React.creat

Add tooltips on column headers in a React Bootstrap table

<BootstrapTable bordered={false} hover={true} wrapperClasses="responsive" keyField="id" data={products} columns={columns} {...props.baseProps} // ref={(n)

Unable to use Ckeditor in React Typescript

'CKEditor' is declared but its value is never read.ts(6133) Could not find a declaration file for module '@ckeditor/ckeditor5-react'. '/ProjectNameUnknown/node

Replace `process.env.XXX` with environment variables

I am building a React app where I need to use environment variables set in .env within javascript files hosted under the public folder (e.g. /public/sw.js). Ide

MUI DataGrid onCellEditStop returns old value

I am trying to use an editing API from "@mui/x-data-grid" and simply have editing on the cell and retrieve the new value. When I use onCellEditStop={(params: Gr

how to pass outlet context to nested route in react router v6

I am using react router dom v6 how can I access the context in a nested route in the second child <Routes> <Route element={<Parent/>}>

How to convert city name to coordinates in JS?

Is there a way to convert city name into coordinates? Openweather api provides access to historical data but i need to have "lat" and "lon" coordinates instead

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