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

How are settings persisted?

ANSWERED

Yay, JSX for settings!

 

From the settings docs, I can see that current settings are passed in as `props.settings` to the settings `Page` component. However, it appears that the *persistence* of settings when not using the explicit `setItem` is a bit of magic that's internal to the pre-defined settings components' behavior and it's a bit hard to follow how things are making their way to settings.

 

For example, it seems that when I create a `TextInput` and provide it a `settingsKey` prop, that's all that's needed to associate it with that key and transparently persist that when I click the submit button. That's pretty straightforward.

 

But when I try to grok the `AdditiveList`, I can't see how the component instance such as a `TextInput` passed to `addAction` gets associated with the `AdditiveList`'s settings key. Is the component instance mutated or wrapped somehow to alter its `onChange`/`onSubmit` prop?

 

Thanks : D

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

We haven't really covered this well in the documentation yet, but persistence of settings can be handled either automatically, or manually. If you're doing it manually you'll have finer control over the data persistence.

 

Each component we provide can be used in either way, and you'll have access to those events too.

 

We'll aim to update the documentation to provide more details in this regard. I hope this helps for now anyway.

View best answer in original post

Best Answer
1 REPLY 1

We haven't really covered this well in the documentation yet, but persistence of settings can be handled either automatically, or manually. If you're doing it manually you'll have finer control over the data persistence.

 

Each component we provide can be used in either way, and you'll have access to those events too.

 

We'll aim to update the documentation to provide more details in this regard. I hope this helps for now anyway.

Best Answer