Category "reactjs"

Toggle class on a mapped element in react

I am learning react and I have some doubts about changing the color onClick How can I toggle the className of a <p> element that is being clicked? At the

How to get the user detail from auth0 in reactJs

I have used the auth0 in react and now I have added the additionalSignUpField in signup the define the user role. So now How I can get the user role while user

Importing react into pages in next.js (and also React and CRA apps)

I have a Next.js app with several pages in it. All of the pages look similar. import React, { Component } from "react"; import from "components/Wrapper"; expo

Testing hover state hooks

I created this useHover hook: import { useRef, useState, useEffect } from 'react'; export const useHover = () => { const [value, setValue] = useState(fals

Deploying FrontEnd and BackEnd as two separate applications with Google Cloud App Engine

I have two application that I want to deploy with Google Cloud App Engine. One of them is react front end, and I want to serve this through www.videoo.io Second

Mixing strings and html links in react/typescript constants

Im trying to mix a string and a link, within an attribute of one variable : const News = [ { headline: 'some headline', text: "some text" + <

How to dynamically create a component tree in React based on an array that contains components?

I have a components array. const components = [ A, B, C, ] Then I want to render this components like this: return ( <A> <B> <

Make screenshot fit window size (full-screen)

I'm using react-webcam to take a photo (screenshot) and set that screenshot to the size of the window. With the code posted below, I'm able to make the screensh

react-mic record audio and send the blob as mp3/wav to backend

Basically I want to record audio and I'm using react-mic for this but it gives back blob but I want mp3 or wav file to send to the backend. How to POST blob fil

Monaco-Editor increase suggestion width using css or props

Is there any way to increase the suggestion width in the monaco editor. I try to find around for an option but I am unable to find it anyway. Is there a css fil

How to remove repeated code for ternary operator?

I'm receiving the data where a lot of fields are null, and I have to populate something if the field is null. like in the below data { //... IGM_ETD: '202

NEXT/Image Component URL issue

I am using NEXT/Image component and facing this issue: When I open the source code on chrome the image src is this: https://www.example.com/_next/image?url=%2Fi

Material UI 5 class name styles

I migrated from Mui 4 to 5 and wonder how to use class names. If I want to apply certain styles to just one component there is the SX property. However, I'm str

When I wrap the index.js with my context provider I just see a blank page

When I wrap the index.js with my context provider I just see a blank page. this is my context import React, { createContext, Fragment, useState } from 'react';

Google's sign in button resizes after loading

I am following https://developers.google.com/identity/gsi/web/guides/display-button#javascript to add Google sign-in to my ReactJS app. I added <script>

ReactJS push to state array replaces every exisitng value in array

I want to push an 2d array into the end of a state. But somehow, when i log the state every time it changes with a useEffect, i replaces every existing array wi

Is it possible to load a Three.js Editor exported scene with React Three Fiber (r3f)

I was wondering some issue during r3f implementation of a scene made with Three.js Editor. There is any issue about loading of json from an exported file ? func

How do I handle res.download(pathname) on frontend(ReactJS)

I have written a code on my server(NodeJS) that will send a .csv file to the frontend with express res.download(path). I would like to know how I can handle the

Formik - setting dynamic values for select box

I have a address form containing country and state field when user selects country i want to fetch state list form backend and update state select box value lis

AWS s3 / React: Password protecting site

I have a react application deployed successfully to a S3 bucket. I need to find a way to password protect access to the s3 url, for example if you open the url