selectable-list
v1.2.0
Published
React Hook for selectable lists ## Installation ```bash $ npm i selectable-list ```
Downloads
6
Readme
Selectable-list
React Hook for selectable lists
Installation
$ npm i selectable-list
import { createListStore } from 'selectable-list'
Usage
const App = () => {
const [data, setData, controller] = createListStore()
...
function renderItem({ item }) {
return (
<TouchableOpacity onPress={() => controller.selectItem(item.id)}>
<View>
<Text >
{item.text}
</Text>
<Text>
{item.selected ? "true" : "false"}
</Text>
</View>
</TouchableOpacity>
)
}