Category "reactjs"

In reactJS, how to copy text to clipboard?

I'm using ReactJS and when a user clicks a link I want to copy some text to the clipboard. I am using Chrome 52 and I do not need to support any other browsers

Which React TypeScript version to use in development?

I have an existing TypeScript React project that was created before Hooks existed in React, and I'm trying to rewrite all the classes using Hooks. Thus in my pa

Why can't `useCallback` always return the same ref

I don't understand why useCallback always returns a new ref each time one of the deps is updated. It results in many re-render that React.memo() could have avoi

Why can't `useCallback` always return the same ref

I don't understand why useCallback always returns a new ref each time one of the deps is updated. It results in many re-render that React.memo() could have avoi

React Native inline styles and performance

Does the following: <Text style={{color: 'blue', fontSize: 30}} /> Have any performance implications compared to: <Text style={styles.blueButton} /

import @react-pdf-viewer/core in meteor js 2.2 cause a problem

import {Worker ,Viewer} from @react-pdf-viewer/core; enter image description here

Webpack dist folder not getting created in project folder?

Everything running fine, but could not able to find where is my dist folder.I am using publicPath as per documentation, still dist folder seems to coming from m

How to display data to table in React Js?

I'm trying to display some data received through API to table in React Js, data is received as object so I can't map trough it. What would be the best practice

use Effect is repeating lottie animation

Learning React here, and I'm simply trying to display a lottie animation. Seems fairly straight-forward, but I'm having some trouble with the useEffect hook.

How preserve query string and hash fragment, in React-Router 4 <Switch><Redirect>?

If you have a <Redirect> inside a <Route>, you'll get a location and can do: <Redirect search={props.location.search} hash={props.location.hash}

AWS: Authorize users to specific clients

So I have the following setup on AWS Cognito: AWS Cognito User Pool: UserPool_1 Under this User Pool I have 3 users defined: Mike, Sarah, John I have 3 App Clie

React functional components vs classical components

I'm trying to understand when to use React functional components vs. classes and reading from the docs they don't really go into detail. Can you give me some pr

Uncaught Error: Connection failed. rtcpeerconnection.t._pc.onconnectionstatechange

Here Is the Reactjs Component code It works fine in the same browser after deploying to heroku but when we join room from different internets this error Uncaug

click play button iframe react

I have an iframe video with a play button (not youtube!). There is no autoplay functionality. So, I want onLoad imitate click this button. How can I achieve thi

Same content on every page

how do I can have different content on different pages? I use app.js as a home, and contact for second page, but whatever change I made in App.js, the change wi

Default Values from API in MUI Text field

I have a form that I built using material UI that I would like to have their default values from an API. The main idea is an Edit screen where the user can edit

How to rerun useEffect when page is visible?

A react app using hooks. In useEffect there is an api-call to populate content on page. Each element fetched is clickable. And a click will open details for the

Why aren't the Tailwind classes taking effect in my Vite React project?

I have a Vite React project that uses Tailwind via PostCSS. However, none of the classes are reflecting the the localhost. Below are the files in the project: p

React Native Download Youtube video

I have tried many examples but all of them are not working. Many blog suggested many things. for example ; add library youtube-video-downloader , add ffbge , ad

@ffmpeg/ffmpeg: Uncaught (in promise) ReferenceError: SharedArrayBuffer is not defined

I have a small react app with a node.js backend (monorepo). The client is using @ffmpeg/ffmpeg, and all works fine locally, but when deployed to Heroku I'm gett