Skip to content

Tag: react-hooks

global React functions that utilize hooks

I have a function called scheduleShortcut that gets used in a couple places throughout an application. Initially, this function was local to the specific components but since it is being used multiple times, I want to refactor this function into a global function. At first, I tried to do the following: Howeve…

React Hooks useState array storage problem

I have the following problem: I have a method that returns a multidimensional array in my Grids component. I would want to store any multidimensional array recomputed in a separate list. The problem is that when I am using my useState() declared in this way only the current state element is saved repeatedly i…

React JS sorting issue

I’m trying to sort some data in my application. I’d like to support the following options: Price (low to high) Price (high to low) Mileage (low to high) Mileage (high to low) It looks like price sorting is working. However, when I click on “lowest mileage”, it keeps showing the highest…

React connecting info between App.js and a class

I am trying to integrate React Scheduler into my app that uses JSON data base. how can I pass the shifts and functions defined in App.js that update the data to DataSheet.js and use them instead of the defaults? Is there a better way to enable the database update from the DataSheet? App.js: DataSheet.js: Answ…