Reference
Identity and Callback Addressing
Look up syntax, contracts, layouts, algorithms, and exact behavior.
A server-owned component tree needs a stable identity model because the client cannot close over JavaScript functions directly. TSXLight solves this by converting event props into callback registrations. The generated markup carries callback identifiers, while the server stores the executable function and its receiver context.
client event | v socket message(user, page, element, event, payload) | v CallbackManager lookup | v invoke server function with stored binding | v mutate component state | v rerender shell for that user
Browser-owned React keeps event handlers as closures already resident in the client runtime. TSXLight handlers are serialized as identities and resolved through server state, so callback routing becomes part of the framework's correctness model.
The implementation regenerates callback IDs during render and clears the active page's callback table during rerender. Old DOM events cannot call handlers for elements that no longer exist. It is a blunt consistency strategy, but the invariant is clear: after a render, only callbacks emitted by that render should be callable.