ConfigMutator
ConfigMutator<
TConfig> = (config,state) =>TConfig
Defined in: packages/react/src/types.ts:53
A pure function that transforms the current config.
⚠️ Despite, the name, you should not actually mutate the config. Instead, return a new config instance.
Optionally used in the update function returned by useUpdateConfig().
Allows deriving the new state from the previous state.
Example:
const {update} = useUpdateConfig();
update( (config) => ({ ...config, theme: userInput, }));Type Parameters
Section titled “Type Parameters”TConfig
Section titled “TConfig”TConfig
The type of the config
Parameters
Section titled “Parameters”config
Section titled “config”TConfig
The entire config
ManagerState<TConfig>
The state of ConfigManager, typically not needed
Returns
Section titled “Returns”TConfig
The entire modified config