State

    How it works

    Noya automatically synchronizes a shared JSON state between all users of a file. The shape of this JSON is defined by your JSON Schema.

    useNoyaState

    The simplest way to access the state in your tool is to use the useNoyaState hook. This hook is a drop-in replacement for React's useState hook, with the added ability to sync between multiple users and the Noya backend.

    Context-based state management

    For more complex tools, Noya provides a context-based API that offers fine-grained control over state management.