Relative Content

Tag Archive for reactjsnext.jsreact-hooks

React page leave operation

I have a nextjs application. There is a page that has a list of documents. If someone uploads a document, the list gets one item added. The task is, if someone moves out of the page and if the list still have some items, we need to call one API for each documents. How can it do it in react and nextjs?

Uncaught TypeError: Cannot read properties of null (reading ‘useState’) while building Next js Module

I have created a Next js Project that I wanna publish as npm module. So I created it configuring tsup. Now I’m trying to use it in another project which I call consumer project that is also in Nextjs. I’m using it locally with help of npm link. Now I’m getting errors of useState in every component whereEver I used it there were few errors of useContext as well. So overall All its not able to identify React. Has someone encountered this kind of situation.

Reusable React hook vs complex javascript response structure

I’m writing a web application using React.
In my code I have plenty different calls to the database.
All of this calls look very similar.
The only difference are table names and parameters and therefore I have a lot of functions that fetch the data.