Category "reactjs"

React State update with button click from another component

Please read the details below of code enter image description here This MegaMenu Component import MenuIcon from '@mui/icons-material/Menu'; import './MegaMenu.c

Linking components in React using React Router Link not working

I am new to React and I am creating a portfolio web page in which I am trying to connect two components with the Link component in react-router-dom (similar to

how to re-register the service worker with next-pwa

I am using next-pwa package with my next.js applications for PWA features. But I am having a problem here. Everytime, I rebuild and redeploy the application, it

what is the correct way to use Sass and React JS?

I have a question. I´m Learning how to use React JS 18v. My question is: what is the best way to use Sass with React? how do you compile it? I don't want

Document is undefined when using apollo query with next.js getServerSideProps

I am trying to use getServerSideProps to fetch a query every time this component is rendered using apollo and next.js export async function getServerSideProps(c

create table from JSON object in react

I am creating a table dynamically in React with the API response as it is as it receives. data = {"name":"tom", "age":23, "group":null, "phone":xxx} It is work

Attempted import error: 'Switch' is not exported from 'react-router-dom'

I don't know why I am getting this error and I can't find an answer for it anywhere. I have uninstalled the react-router-dom package and reinstalled it, but it

Trying to run function only if state changes

I want to run the set totals function only if the hour's state has changed. It is running every time the component mounts instead of only if the value changes.

Using function defined in custom hook does not update some value in the state

i recently started using react and i'm trying to write a custom hook used for translating some ui elements. I'm not using a library because it is a larger proje

Can't retrieve data from POST in django view

I have issue with retrieving data from POST in my django view. I send React form values with axios to my django backend. I believe data gets put into POST but s

React + Webpack 5 + Babel 7 IE11 issue -- not attaching to root

I have been scouring the internet for solution after solution and nothing seems to be working for me so I'm requesting help. Issue: No matter what I do, I can't

Firebase, Changing User password via Email with unique password requirements

Currently, Firebase offers the option to send an email to a users email who wishes to change their password. Unfortunately, Firebase does not allow you to edit

React Router 6 in Electron - No routes matched location

I am trying to use react-router v6 in an electron js application. but it doesn't work for me. This App works correctly without implementing the react-router! Wh

Fetching data from websocket to react

I'm relatively new to React, and am looking to combine my React application with a websocket connection. I'm able to establish a connection via the websocket co

GatsbyJS - GraphQL ACF query issue

So I am encountering some issues with the way that my ACF is structured on a custom post type. Due to the way the post type works (it's for work case studies) t

Render() Modal test Jest Enzyme

I am not really how to test render() Modal. I am able to set up the props and test Render () " make sure it render with all the props" correctly " without any p

Dynamically Position an Element on webpage

I am trying to use a Emoji picker inside my React application and there are 2 buttons on the page to toggle the picker, I want to show the picker at the positio

How to transform the word Gr\u008Egoire to it's normal form in Javascript?

Hope you are doing well! I have a list of french names with accents, but I receive them encoded like "Gr\u008Egoire", but I want to display the real word. Thank

Firebase notification supports webpack from what version?

Im using "webpack": "^4.16.1" when i create a create-react-app the Firebase notification works fine but when i install like that on webpack4 it shows the follo

toHaveStyles not working with module.css styles using React testing library with Jest

I have this component for which I am writing test case using react testing library I am facing an issue with styles when the styles is imported from .module.cs