Category "reactjs"

What's the easiest way to play youtube video in <video>tag in React

I am trying to play youtube video in html5 tag but I am getting some error <div className={classes.VideoContainer}> <video className={classe

Can't stop the asynchronous flow

I have the following function: const handleSubmit = async (event: React.FormEvent<HTMLFormElement>) => { event.preventDefault(); const

how to attach picture to another picture?

I want to do synchronising device, it measures phase shift between phases. It's a measurement device, that have a pointer like a clock. It consists of two imag

Input value not updating, dynamic input box when user opens popup window react/next js

I have a problem where when a user opens a popup window to change their name, email, password, etc. the input box where they'd add their change won't collect th

Convert normal string to datetime format

Is there any way to convert normal string 5pm into 2022-04-20T17:00:00.000Z format? I have got this from backend but Im using timepicker in antd. It only accept

Best way to provide admin role from Django REST to ReactJS

The default django user model has a is_superuser field. I would like to use this field to conditionally render components in react, i.e. get something like this

Hero section video overflowing (CSS/React)

How do you make a navbar and hero section that fills the height of the screen, and not scrollable? Currently I am trying: My nav css: .NavStyle { top: 0; wi

After adding env file to my project the firebase auth is not working, console showing the api key is not correct

Here how I connected firebase with environment variable: const firebaseConfig = { apiKey: process.env.REACT_APP_apiKey, authDomain: process.env.REACT_APP_

Js .map giving unexpected results

this is my code for map and this is giving unexpected results: console.log('results', results); let newResults = [...results]; newResults = results.map((el) =&

TypeError: ‘undefined’ is not an object (evaluating)

I'm started react-native tutorial on youtube, and I get error this one. TypeError: ‘undefined’ is not an object This is File it is showing from:

How to fetch with parameters using React Query?

For the sake of this question let's first assume existence of such entity: export interface Event { id: number; date: Date; } Then let's assume there's

Next.js - Why I get hydration error in my header component

I am working on a job portal, I get user authentication using JWT and store it in local storage. I get hydration error in my header component when authenticated

How to add spinner for loading to fetch API from MongoDB?

Custom hook .js import { useEffect, useState } from "react"; const UseHook = () => { const [items,setItems]=useState([]); useEffect(()=>{

when I use setTimeout for show user is typing or not then its working but its blinking when I am typing continuously

I am using setTimeout and its working but when I am typing continuously then also its blinking How I can solve It ? messageHandler(ev) { const message =

Socket.io Client repeats event action multiple times from one emit

I am creating a simple diffie hellman demo with sockets and it seems that whenever my server emits any event, the client repeats it multiple times. For example:

reacr ssr template won't run : help fix code base

This is an attempt to demo how to utilize react ssr however it is not functional. See git repo and I appreciate any insights or PRs to fix the issues. Clone wit

Display Fetched Data from API in react and display in responsive table?

I try to make a responsive table to display fetched data from API in react.js. I designed a table but it is not responsive. <TableContainer > &l

Tailwind CSS custom gradient with React state and FastAverageColor

I'm trying to add a custom gradient over an image using React state, Tailwind CSS and the FastAverageColor package (https://www.npmjs.com/package/fast-average-

Why logout navlink doesn't work with localStorage?

I'm trying to use localStorage in order to connect/disconnect users on my website. I tried to manage this with a condition on click on the navbar (it concerns t

Electron-React error: I keep getting undefined error while reading 'ipcRenderer'

I am trying to create a desktop application using Electron and React. I set the basic settings using electron-react-boilerplate. https://github.com/electron-rea