Skip to main content

useState

Callable


  • Return a new Ref containing the state for the given meta.name and key.

    @example
    const app = { name: 'my-app' };
    const counterRef = useState(app, 'counter', 1);
    counterRef.current += 1;

    Type parameters

    • T