React Quick Start
Create a React viewer host, open a document, and enable a text annotation with the NPM SDK.
Create a TypeScript React application, then start from this minimal structure.
Keep the viewer lifecycle in the component that owns the viewer region.
Install the Viewer package in the new project. The document URL in the next step must be reachable by the Canvas environment.
Use a ref for the host element. Register document listeners before startup, await mount() and ready(), then open the document. The cleanup function unsubscribes and destroys the viewer when React removes this component.
The example enables the verified TEXT annotation action after the document has opened. It clears the host tool state when the documented created event arrives.
Creating an annotation is not a persistence confirmation. When the host must save changes, use the result-backed save flow documented in Annotation API and Save annotations.
