BFE.dev
buy us
a coffee
CompanyListsDiscuss
buy us
a coffee
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

Always try to find a better approach.

(37)

Try it out

Console