Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

useViewWriter

useViewWriter(): ViewWriter

The writer a view writes its page’s own state with: a Reach.Local trait, such as a pinned target, a camera’s or a drawn aim, from the view’s useFrame, an input handler or an effect, while the view is mounted and between steps: setTrait(writer, world, CameraLeanTrait, { roll }). spawnLocal(writer, ...) makes a page-only entity and findAuthority(writer, entity) takes it away. A trait the room streams is the room’s to write, so a view sends a command for it. Outside a view it throws in development, naming the component, and in a built game logs once and hands a writer that writes nothing; a logic component writes through useAuthorityEffect or useSetupEffect. As Roblox’s LocalScript writes what never replicates.

ViewWriter