March 2019
Intermediate to advanced
534 pages
14h 52m
English
You can have more than one control in your list item. For example, let's say that in addition to toggling the Bluetooth state of a device, another common action for your users is toggling the power state of the device. When the device is powered off, the list item and the Bluetooth control should be displayed.
Avoid having too many controls as secondary actions in your list items. Doing so detracts from the convenience of having one or two common actions easily accessible by your users.
Let's start by adding a new power state to each item in your component state:
const [items, setItems] = useState([ { name: 'Device 1', bluetooth: true, power: true, Icon: DevicesIcon }, { name: 'Device 2', bluetooth: true, power: true, Icon: ...Read now
Unlock full access