React hook for managing settings.
Settings manager to use.
Key of the setting to manage.
Optional
Value to return if the key does not already exist.
A tuple containing the current value of the setting, and a function to set the value. Works like useState.
useState
import { components, settings } from "replugged";const { TextInput } = components;const cfg = settings.init<{ hello: string }>("dev.replugged.Example");export function Settings() { return <TextInput {...cfg.useSetting("hello", "world")} />;} Copy
import { components, settings } from "replugged";const { TextInput } = components;const cfg = settings.init<{ hello: string }>("dev.replugged.Example");export function Settings() { return <TextInput {...cfg.useSetting("hello", "world")} />;}
React hook for managing settings.