Category "reactjs"

Can't combine a hook and a function in onClick event

I'm new to React. This is a 3 step registration form. In the last step - StepThree, I've been trying to have a hook - handleDateChange and a function - HandleUs

Dynamically load React component library from URL?

I am working on documentation tool for Typescript library. The idea is to leverage parcel's watch mode to continuously build the library, and use the same in a

How do have modal pop up when hovering over bootstrap 5 card?

I was following a template I found online to have a modal pop up when hovering over my cards with bootstrap 5. This is my code so far: class SavedEpisodes exten

React Router Link is not working. The Route changes but the component doesn't get rendered [duplicate]

This is the code in App.js import React, { Component } from 'react' import { BrowserRouter as Router, Route, Switch} from 'react-router-dom';

how to change prettier format for react native

my code formatting prettier didn't works well for react native, i don't understand where to config it but it works well with flutter from this code import

react-router-dom v6 params only numbers

I want add number regex in may param in react-router-dom v6. it work fin in v5 like it: <Route path="list/:id(\d+)" element={<MyComponent/>} /> b

How to update @type/packageName according to updating packageName?

My current packages - - [email protected] - @types/[email protected] I updated my lodash version to minimum stable one as [email protected] Now, what will be the @ty

Organize large states with redux toolkit

I am fairly new to redux and redux-toolkit, but I am fairly familiar with the whole concept of stores (coming from a vuex background). I have an issue organizin

Best way to style non-MUI elements in MUI?

I'm new in React and a new dev in general; I know that there are many ways to style elements in React itself: importing CSS, locally scoped CSS modules, CSS-in-

How can I fixed my problem"FirebaseError: Firebase: Error (auth/invalid-api-key)."

My environment variable is ok. No comas and name mistakes but they given me error like "FirebaseError: Firebase: Error (auth/invalid-api-key)". How can I fixed

React Browser Router v6 not rendering element on refresh

Routing seems to be working fine until I go to a child route and refresh the page. After refreshing the page the element disappears and the only way to fix it i

nextjs router locale undefined

I have done a lot of research and tried many things, but unfortunately, I haven't found a solution, so I had to ask again. I am working locally on a project and

router.push() is not working as expected NextJS

I am trying to redirect the user to the search results, but router.push() is not working apparently. I changed url to page that don't exist and the route change

How can I use functional update with event.currentTarget.value in React?

First, please check my code. const [name, setName] = useState('nick'); const handleChangeName = (e) => { setName(prevState => e.currentTarget.value) }

React useState hook does not update the lonlat value in OSM

I´m stucked with not updating react useState hook setPosition(lonLat) line 34. Could someone advise me please why that does not working? The position cons

How to order comments in firebase firestore by createdAt

I have a document in which there is a comments array of objects and each object has createdAt property. I want to sort all the comments that are inside the comm

xterm-addon-fit not working when it parent is a tab has forceRender={true}

I'm using forceRender={true} in order to preserve the state/context of the xterm.js termina emulator. However, when it's set, fitAddon.fit(); doesn't work.

How can I obtain an image link that is in the body of my GET request using React.js?

I am using a spring boot backend with a react.js frontend for a web application. Once a user is logged in, it directs the user to their Profile where they will

How to set default value on language changer to the current locale?

I am having a problem setting the "defaulValue" of a Language selector to display the locale it is in. ** Note: I am using Nextjs and TailwindCSS My code looks

onChange is not working in react functional component while changing the value through state update

I am using mapbox in a project and here I am trying to get the latitude and longitude from the input box. I have set a value in input field and I want to change