Category "reactjs"

Is it recommended to pass setters from useState as props?

I am currently in a coding bootcamp and the instructor told me that it is not best practice to pass the setters defined in my useState as props to children comp

Error: Can't resolve 'fs' in node_modules\dotenv\lib' in React web app

I installed dotenv using npm install --save dotenv in my React web application. Whenever I use require('dotenv') this error comes up. Error: Can't resolve 'fs'

React setState componentDidUpdate React limits the number of .. when trying to update the state based on updated state

i have react program that need the data from other components. When the parent components send path data, an array will get all of the files name inside folder,

Why React Component render many time when get event from socket.io?

I am using socket.io for my project social network web, when user connect I join, but when I get message from socket.io by group chat, My component render messa

reactive programming in react

I have a fundamental question about reactive programming in react. As you know, a react component re-renders only if one of its props changes and does not aware

State is not Setting

I am trying to store the result of my backend, which is a list of inventories, sent from my backend powered by Microsoft .Net 6 Web API. But I can't figure out

How to change the style of an element retrieved from JS getelementbyid in react?

I'm trying to target an element in the the DOM that has already been returned, and rendered, by another component; I was hoping to use a getElementById() call,

How can I expose React Hook outside of my React Functional Component

I have a React Functional Component like this: export const MyParentComponent = (props: Props) => { const [myObjects, setMyObjects = React.useState< M

(Gatsby) Easiest way to diverge from the `SEO.defaultProps` on a per-document basis?

Most of the pages on my website are in Norwegian— Seo.defaultProps = { lang: `no`, ... } Some articles, however, are in English. I use some automatic

React-query mutation dosent refresh

I have another fetch of "SpecificList in another component, but when posts excutes it dosent refetch it only refetches on rewindowfocus? What could the reason b

I get an error about "browserObject" on the console only in case of chrome in react app

I'm making an app with React. Only in Chrome, the following error is output both on localhost and after building and deploying. it is error. I did not find the

I want to display fetched data from api in form columns (auto fill data) in React.js and Mysql

i am using onKeyUp event for fire api without submitting the form and i fetched data in response successfully if Mobile number matched. But i don't understand h

Change color of Pathlayer on Click, MapBox DeckGl React.js

I have a mapbox React.js component implemented with DeckGl I am trying to make my Pathlayer color changes on evenry mouse click (onClick), using onClick, getCol

Working with promises in a React class component

I have this module to fetch data using the Spotify API: const Spotify = { getAccessToken() { ... }, searchTrack(searchTerm) { const accessToken = Spoti

I am using React Bootstrap Table and function base component and I need to save page number, size per page and text filter for reuse

I need to save page number, size per page and text filter for reuse. Suppose I'm at page 3 and text Filter is "submitted" and sizePerPage=50. Then I got to ano

Task not found: "react-scripts:start"

I've configured tailwind.css to my react project and edit the react scripts according to "scripts": { "build:css": "postcss src/styles/index.css -o src/styl

Getting 'could not resolve "jest-config" package from the "jest" npm package directory.'

I am getting "jest-config" package from the "jest" npm package directory error when I try to run e2e test for android application, I am using detox test -c a

How to prevent svg on top of other div of triggering mouseleave

I have an issue with mouseleave. (React/Typescript/CSS/HTML project). Situation (see picture at the bottom) I got two div elements <> <div id="main"

Can I use expo packages in react native cli?

Can I use expo packages in react native cli ?

react I want to change the order

When the button is pressed, I want it to swipe in the following order: yellow, red, blue, green.