React Revision Workflow
Build a React + TypeScript revision workflow with the Rasterex NPM package. The example keeps each file separate so teams can copy the pieces into an application without unpacking tabbed snippets.
This workflow creates one page where a user can enter a background drawing URL, an overlay drawing URL, choose DPI, and run either direct comparison or interactive alignment.
For NPM, the Revision API exposes terminal events for comparisonComplete and comparisonError. Keep local pending state around the action you invoke, then clear it from those terminal events.
Start with Vite, then install the Rasterex viewer package.
Keep the UI state and viewer result shape explicit. The result payload can be empty during the first interactive align stage, so the UI treats it as optional.
Mount the viewer once, subscribe only to documented NPM revision events, and expose simple actions for compare and align.
The form makes common actions easy: swap background and overlay, choose compare or align, and keep inputs editable after failures.
Compose the form, live status, result link, and viewer surface. Button disabling is driven by local action state, not progress events.
Use a two-column operations layout on desktop and stack the controls above the viewer on smaller screens.
Run the app, open two compatible documents, and confirm compare emits comparisonComplete with an output path.
For align, confirm the first comparisonComplete can represent the interactive alignment stage and the final comparisonComplete returns the generated result.
Force an invalid URL and confirm comparisonError unlocks the UI while preserving the user inputs.
