Category "reactjs"

How to access functional component inside a function from an external JS file?

export default function HorizontalLabelPositionBelowStepper() { const [activeStep, setActiveStep] = React.useState(0); const [completed, setCompleted] = Rea

Redux toolkit useselector doesn't grab the state properly

I'm trying to store my current user using redux toolkit. I'm dispatching the action in the Login page and it looks like when I try to grab the user state on tha

How can I fix this select dropdown in React?

I'm revisiting a React app that I created years ago because the dropdowns are no longer working. Code snippet below. render() { return ( <div class

Loop through array with setInterval play button and pause it

I want to loop through a array with a pause and a start button. Right now it automatically plays and I am not sure how to connect the setInterval to the play fu

How to add typescript paths to storybook

I have a react application with a custom Webpack configuration. After adding Webpack aliases that matches tsconfig.json file compilerOptions->paths field the

hide Navbar if user inside dashboard using React js

I am creating my collage project and I want to hide the navbar if the user in window.location.pathname === "/admin" || "/employee" || "/publisher" basically if

How do I call react function in js map?

I have the below code, the problem is in the part where I am calling the RemoveProduct function in the map function: function AddOrder() { const d = new Dat

Lazy initial state - What it is and how to use it?

I am new to react Hooks. Am trying to make use of useState in my code. While I was using it I found a term "Lazy initial state" https://reactjs.org/docs/hooks-

npm install react-google-login not working

i am using following command to install react-google-login for react npm install react-google-login but its not working npm ERR! code ERESOLVE npm ERR! ERESOLVE

Stand-alone React 18 page warning: importing createRoot from "react-dom"

I'm trying to create a stand-alone webpage that uses React 18: <!DOCTYPE html> <html lang="en"> <head> <title>Hello React!</

How to delete a document attribute in Sanity iO?

I have an array of objects in my Sanity Document called Images called Comments an example comment object in comments[] array looks like : { "_key": "651

React Big Calendar Navigate

In my calendar, I made the option to open and close it, but when I close it, and open it again, it is in the month I stopped after closing it, and not in the cu

BottomNavigation in MUI cannot resize smaller than 400px if containing 5 items

I have a bottom navigation that contains 5 elements. When you resize the window lower than 400px, the bottom navigation doesn't "squeeze", so to say; it remains

React-Typescript: I don't find the problem why my getCurrentTime Function won't work

I am trying to write a function to display the difference time between current time and e.g. the creation time of a message. Herefore I wrote a function to get

React remove the "create-react-app" description

I'm struggling with removing the nasty description of the create-react-app boiler plate: Web site created using create-react-app. As stated here and here I have

How to fix came case error on netlify without changing the entire react app?

I am trying to deploy this site but it keeps failing. https://aquamarine-pithivier-8afda3.netlify.app/ It runs perfectly locally, but on netlify it doesnt. I go

in React, is <input value={func(item.foo)} a performance problem?

I may be mixing best practices between React and Angular... in React, does this incur performance penalties or memory issues? I know it's not good practice. In

Why are state values ​returning undefined? with reactjs

const [value, setValue]=useState(); useEffect(() => { authService.getAddr().then((response) => { setndata(response.data); }, (error)

I'm trying to implement Infinite Scrolling in a React application using the IntersectionObserver API but i'm running into some issues

I'm trying to implement infinite scrolling and it's supposed to work by getting data in pages from the API...and then using the IntersectionObserver API, checki

How can I conditionally render tabs depending on the value of a field of a GROQ query?

I have a GROQ query where the result is an array of documents, of which one of the fields, "fieldName", can contain "a", "b" or "c". If the array contains any w