Category "reactjs"

Is eslint pre-commit hook in CRA bootstrapped application required?

My react application is bootstrapped using CRA(react-scripts v4.0.0) and I want to add a code formatter (prettier to be specific) that must format the code befo

How to add items to array in react

Code: export default function App() { const [name,setName] = useState(""); var myArray = []; const handleAdd = () => { myArray = [...myArray,name]

how to I get a user's IP address when separate client and server apps, in Node with Nest.js

I have two apps, one front end (react.js) and one a REST API back-end(nest.js based on express.js). How do I get the IP address of the user accessing the back-e

How do I translate Country name pop-up to other language in jVectorMap - React

I have been looking for the answer for a long time but couldn't find any solution. Let's say my website's default language setting is English and when a user ho

Issues when converting a class component to functional component

I've attempted to convert the following demo.js class component here into a functional component over here (demo.js) and when I attempt to make a change, I rece

How to get rid of React-Quill image resizing warning?

Implemented image resizing with React-Quill. The module I used is "quill-image-resize-module-react" and it's working fine. However, whenever I change the conten

Add notification to Windows notification center without displaying it on screen

I am building an Electron app featuring a custom Notification feature where html5 divs appear and disappear as needed on a frameless, transparent, always-on-top

Material UI responsive grid direction

I want the container direction as "row" above md size screen and "column" below md size screen? How can I implement it? <Grid container direction = "row"(in

Confused about how to create a ref if there is no forward ref?

There are three options, I don't know which one is the best. //@ts-nocheck import React, { useEffect, useRef } from "react"; export const Child = React.forward

admin pages in Next js that only authorized users

I have admin pages in Next js that only authorized users should have access to. I have a cookie verification service: import { NextApiRequest } from 'next' impo

How to make a marquee animation which never leave the view blank ? With images

I am trying to make a marquee animation, but i can't manage to make it perfect. As you can see when a logo goes out of the page it do not get back from the othe

How to integrate a React webapp inside a spring boot Application with jar packaging

We have a react webapp and a spring boot application(built with maven) in development. The React app(on npm) and boot app are running separately but time has co

Deploying React app to production returns "You need to enable JavaScript to run this app"

Problem I have an axios call at "/artists", that gets a list of artists returned as an array of JSON. It works in development. However, in production it outputs

Sending cookies/sessions to subdomains

As the title says, I'm trying to set cookies/sessions on the browser. To preface: Frontend: https://www.example.com Backend: https://api.example.com Frontend ma

How to delay updating React state in react-swipeable-list?

I'm trying to use react-swipeable-list to enable swiping in a pair of lists (the first is a list of items I might shop for, the second list is the list of stuff

MenuIcon not found in MUI

I'm trying to implement a appbar from mui which is include a MenuIcon. I've tried import MenuIcon from '@mui/icons-material/Menu'; from mui documentation. But i

Protected routes not accessible even after signing or logging in

I am making a site whereby after the user signs in, the user is meant to be redirected to the home page. The homepage and all the other pages of the site are on

Unable to load script.Make sure you are either running a Metro server or that your bundle 'index.android.bundle' is packaged correctly for release

react-native run-android command terminates by leaving a message in android simulator. The message is as follows: Unable to load script.Make sure you are eithe

Updating the useState values automatically in react js?

I have a usestate array object called mo, which gets the data from an rest api from get request. I use useEffect for getting the data. const [mo, UpdateMO] = u

How to resolve rollup build error when using emotion: 'default' is not exported by @emotion\memoize\dist\memoize.cjs.js

I'm trying to build a standardized react button component for our enterprise library. I want to be able to use @emotion/styled to generate the styled react comp