Category "reactjs"

Should we be using the unsubscribe method returned by Auth.onAuthStateChanged() in firebase to clean up memoery leaks?

Here is my code: import React, {useState, useRef, useEffect} from 'react'; import { getAuth, onAuthStateChanged } from 'firebase/auth'; import { useNavigate } f

Change nested object with one function in react

I have this kind of object where I want to change the Ethereum value for example; const [reportData, setReportData] = useState({ nameOrganization: "test5",

Acces to XMLHttpRequest at 'https://api-link/login' from origin 'http://localhost/3000' has been blocked by cors policy. (React, , firebase, JWT))

When I try to implement a secure login system in React application with firebase using JSON Web Token (JWT) I am getting this error: Acces to XMLHttpRequest at

Uncaught TypeError: Cannot read properties of undefined reading pathname

I am getting this error while running the below code import React from 'react'; import { Link } from 'react-router-dom'; const DanimProduct = () => { re

What is the status of the 'default props rerender' trap in React?

I'm looking for a canonical reference to how this has been dealt with. If I have a component that looks like this: const MyComponent = ({ value = [] }) => {

How to use useContext correctly,

I want to take out the function and state globally, because the function and state use the global header. But how can my MainPage page get this data? I know tha

React: React-Bootstrap Collapse is not working

Started using React-Bootstrap today and I want to make a collapsable card. Using Collapse component but it's not working. Any tips? My code: import { RiArrowDow

Redux toolkit filter() not working when wanting to display new array at the same time

I am currently building a clothing shop in which you can add products to the cart, and delete each one of them as you like and it makes the cart re-render and d

Typing custom event with typescript

I'm asking for a suggest on how to type correctly the schema for how an EventObject should be, including what's inside the "extendedProps" key. As of now I've d

How would I get the data I need from this array?

I am trying to get all the data from my firebase firestore and put it into a javascript react table but I am having a difficult time. async function GetAllDataO

Redux & TypeScript: Property 'X' is missing in type 'DefaultRootState' - but the property is declared in Interface

Here's my Interface which I'm using with mapStateToProps: export interface IStore { cache?: any; dataManager?: IUR; userPrefs: IUP; fingerprintModal?: I

Bundle CSS in publishable NX React library

I created a publishable React library that contains some custom styles. When I use this library (component) within a demo application in the NX project, I do no

Why can't I display more data from firebase?

I know I am making a mistake somewhere. I am trying to display all food items from my firebase database onto my restaurant website. So far, I can only display "

Reactjs: Complex Nested forms and managing State

I am using ReactJS and MUI components to create a dynamic form based on the following JSON. { "form": { "groups": [{ "group_id": "acfcbaa6-3bb9-45c0

Airtable blocks: Multiple useRecords hooks to different tables force repeated app restarts

My blocks custom app is reading data from multiple Airtable tables, then displays them in context and interconnected. To be able to react to user changes I'm us

Wait for previous dispatch action to complete

const onFeedSubmit = async (data: PostFeedActionProps) => { try { setPostingFeed(true); selectedBusinessList.forEach(business => {

How do i re-run useEffect hook if the localstorage value has been changed?

I'm trying to re-run the useEffect hook based if any new item has been added to the localstorage. My useEffect looks like this : useEffect(() => { //ge

meteor How to use upsert | Exception while simulating the effect of invoking ” TypeError: Cannot read properties of undefined (reading ‘_id’) react.js

I’m having trouble with upsert with meteor.js. I could update questions finely with the below codes but I won’t be able to insert new data. file in

Why onchange, onblur and useRef doesn't work with react hook form?

I tried to use the useRef hook, onChange, and onBlur with react hook form fields. But it doesn't seem to work for a reason. Can someone please explain why it do

CORS problem,using axios,how can this be possible?

I'm using gin to be my backend,and this is my cors middleware code. func Cors() gin.HandlerFunc { return func(ctx *gin.Context) { method := ctx.Requ