Implement a useCycle hook that cycles through a sequence of values each time the returned function is called.
useCycle
export default function Component() { const [mode, cycle] = useCycle('low', 'medium', 'high'); return ( <div> <p>State: {mode}</p> <button onClick={cycle}>Cycle</button> </div> );}
The useCycle hook should accept an indefinite number of arguments, each representing a value in the sequence to cycle through.
A tuple containing the following elements:
value
cycle
console.log()