BFE.dev
React Coding Questions12. useArray()

12. useArray()

ReactHooks
Share

  - accepted / - tried

When array is used in React state, we need to deal with actions such as push and remove.

Implement useArray() to make life easier.

const {value, push, removeByIndex} = useArray([1, 2, 3])
prevnext

What is time & space complexity of your approach?

Request SolutionAIPosts(114)

Try it out

Console