Closed 3noix closed 3 years ago
At the first line of the "go" function, there is a problem with the second index check: with the current code it is not possible to go to the last state. It should be for example "if (index < 0 || index > historyRef.current.length-1) return".
Good catch. This will be fixed in the next update I make to the library. I have 5 hooks I am planning to add in a week or so.
At the first line of the "go" function, there is a problem with the second index check: with the current code it is not possible to go to the last state. It should be for example "if (index < 0 || index > historyRef.current.length-1) return".