Skip to content

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,
})
);

TConfig

The type of the config

TConfig

The entire config

ManagerState<TConfig>

The state of ConfigManager, typically not needed

TConfig

The entire modified config