Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Set toggle to default (SOLVED)

how do I force a toggle in /settings/index.jsx to be true when the user installs the app for the first time?

 

I've tried this at the end of the file

 

 

props.settingsStorage.setItem('myToggle', 'true')

 

 

 

but I get: Uncaught ReferenceError: props is not defined

 

If I place that statement inside the function where props was passed, I get

 

 

Best Answer
0 Votes
1 REPLY 1

I overlooked the fact that I accidentally threw it inside of a return statement 😖🤦‍:male_sign:

Everything is ok

Best Answer
0 Votes