09-02-2017 08:18 - edited 09-02-2017 08:20
09-02-2017 08:18 - edited 09-02-2017 08:20
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
Answered! Go to the Best Answer.
09-03-2017 10:00
09-03-2017 10:00
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.
09-03-2017 10:00
09-03-2017 10:00
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.