Type Parameters
- Settings extends Record<string, Jsonifiable>
- Defaults extends string | number | symbol
- PathKey extends string
- Fallback extends undefined | {} | Jsonifiable
- Path extends string
- Value
Returns {
onChange: (
newValue:
| ChangeEvent<HTMLInputElement>
| ValueAtPath<Settings, Path>
| Settings[PathKey]
| Record<string, unknown> & {
checked?: ValueAtPath<Settings, Path>;
value?: ValueAtPath<Settings, Path>;
}
| Record<string, unknown> & {
checked?: Settings[PathKey];
value?: Settings[PathKey];
},
) => void;
value: Value;
}
A tuple containing the current value of the setting, and a function to set the value. Works like useState
.
React hook for managing settings.