06-14-2018 11:35
06-14-2018 11:35
In my settings index.jsx file I have a toggle that when it is set to true, it enables a select setting in which the user can then select up to 3 items. What I need to do i when the toggle is set to false, to not only disable the select setting, but clear any items that may have been selected. I am trying to use prop.settingsStorage.removeItem. Here is my code. Any help is appreciated.
<Toggle
settingsKey="toggle"
label="This is a Toggle"
onchange={() => props.settingsStorage.removeItem(selector)}
/>
<Select
label={`MultiSelector:`}
multiple
settingsKey="selector"
options={[
{name:"item1"},
{name:"item2"},
{name:"item3"},
]}
disabled={!(props.settings.toggle === "true")}
/>
Best Answer06-30-2018 07:11
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
06-30-2018 07:11
removeItem expects a string of the key.
onchange={() => props.settingsStorage.removeItem("selector")}
Best Answer