Assignment Content Create a component that makes use of the following three hooks: useState() useCallback() useMemo() Th
Posted: Mon Jun 06, 2022 1:48 pm
Assignment Content Create a component that makes use of the following three hooks: useState() useCallback() useMemo() The component should have an input that accepts a number and its' value should be bind to the state of the component. Then, memoize a function that has a for-loop of length 1.000.000 and that checks whether the number exists in the range of the loop. If the number exists your memoized result will be true, otherwise false. Finally, with the use of the useCallback() hook create an onClick listener for a button that manually sets the state of the number to what it currently is. Both useMemo() and useCallback() should have as a dependency the state variable bound to the input. (Everything in this assignment is according to what was shown during the lecture).