Category "reactjs"

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

React setState not Updating Immediately

I'm working on a todo application. This is a very simplified version of the offending code. I have a checkbox: <p><input type="checkbox" name="area"

What is Virtual DOM?

Recently, I looked at Facebook's React framework. It uses a concept called "the Virtual DOM," which I didn't really understand. What is the Virtual DOM? What a

How to tell parent component that I need updated props?

I have a component which is a form that receives props. When I save the form I want to tell the parent component to send me updated props. How can I do that?

How to hydrate server-side parameters with React + Redux

I have a universal React app that is using Redux and React Router. Some of my routes include parameters that, on the client, will trigger an AJAX request to hyd

Disable scroll in View on Expo Web

I am using Expo with react native and just have a plain view with some things inside of it. When I run the code as an expo app on my iPhone the view does not sc

Hot Reload is not working in my React App

I have created this app with npx create-react-app. After this i have deleted all the files except index.js in src folder. Then Hot reload is not working. I have

First Load JS shared by all is rather heavy in next.js

I have a project on Next.js framework and the problem is that First Load JS shared by all pages is rather heavy. I want to know what possible aspects I can tak

I can't setup proxy in mern stack(react-vite) and do not know the reason

I'm developing mern stack web application with react from vite.js and have a problem to deal with proxy. my client side runs at http://localhost:3000 and server

Error while installing node module in ReactJs

I just cloned a React application from Git that doesn't have node_modules on it. I try to install with command npm install but unable to do it. Following error

Error while installing node module in ReactJs

I just cloned a React application from Git that doesn't have node_modules on it. I try to install with command npm install but unable to do it. Following error

Zustand is updating all the components on single property state change

Two different child components using the Zustand store are rendered on every state change. Though the state property they are using in the component is not upda

React Router not working with Github Pages

If you go on my site, https://amodhakal.github.io/portfolio/, then you would realize that that the site is only showing the navbar, not the home page. It only s

How to update a form's input text state immediately in React using setState()

const [text, setText] = useState(''); const handleTextChange = (e) => { setText(e.target.value); } // Inside a form <input onChange={handleTextChange

How to create a new user along with their profile images in Sanity?

Hi I am a beginner to Sanity and I am working on a personal project. All I want to know is how do I add a user along with his profile Image selected as a file f

How to create a new user along with their profile images in Sanity?

Hi I am a beginner to Sanity and I am working on a personal project. All I want to know is how do I add a user along with his profile Image selected as a file f

State Not Updating when Consuming React Custom Hook that Uses Axios with useReducer to Get Async Data

My app returns a "null is not an object" Render Error when consuming the useFetch custom hook that I made to get async data using axios. The status, error, and