yarn add use-selected-items-hook
npm install use-selected-items-hook
To initialize the items
array, the initialItems
must be passed as an argument. It's also possible to initialize the items already with an isSelected
state, but to do so, it's necessary to provide the initialSelectedItems
argument.
selectedItems
: The items that are currently selected.listItems
: The items with the status ofisSelected
. Refer to the Usage.
-
toggleSingleItem
-
toggleAllItems
es
(EcmaScript module)cjs
(CommonJS)
Question: What are the technologies used in this project?
Answer: The technologies and libraries used in this project are React + TypeScript and Immutability Helper to handle the array manipulation.
Feel free to file a new issue with a respective title and description on the the useSelectItems hook repository. If you already found a solution to your problem, I would love to review your pull request! Have a look at our contribution guidelines to find out about the coding standards.
Check out the contributing page to see the best places to file issues, start discussions and begin contributing.
Released in 2020
This project is under the MIT license.
Made with love by Laura Beatris 💜🚀