Hello :)) I not familliar with custom hook in React. I have tried simple ones, but example below I don't know how to resole
I want write a hook that will work similarly to useState, except that it should update the state only when the new value is different from the previous one.
The first hook parameter should be the default state value.
The second optional hook parameter should be a function that compares these values. If both values are equal, this function should return true
. If the function is not passed, then the comparison of the values will take place using a simple comparison.
Thanks for your help :)