Skip to content

Tag: reactjs

Object does not hook [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 6 m…

middleware.js in nextjs doesn’t work at all

(Next v.12.2.3) No matter what I code, pages/middleware.js seems not running at all! I wanna redirect uppercase urls to lowercase urls. what should I do? Answer The documentation says: Create a middleware.ts (or .js) file at the same level as your pages directory So it shouldn’t be inside pages/, but in…

Pass array value to getStaticProps in Next js

I’m doing fetch request to get my Youtube playlist. and in doing so i used getStaticProps(), the problem I’m facing is that my playlist depends on my array of objects result. the array of objects structure is in my ./utils/playlists.js file. what i want to achieve is that instead of getting my con…

react gets stuck after i resize the browser window

I used react-simple-image-slider for image slider on my website, but after i resize the browser window the application gets stucked. The main Aim is to make the react-simple-image-slider responsive. The below is the code. Answer You forgot a dependency list for useLayoutEffect so it’s adding an event li…

React component not rendering at all

Here’s the code: I’ve been trying to learn React using this online MOOC. I’m on exercise 2.12* Data for countries, step1 and I’m stuck. My search is running fine but I’m unable to solve the last part of the problem: printing information of a selected country or if only 1 country …