React is the dominant library for building interactive web interfaces, but building high-polish micro-interactions requires careful architecture to avoid re-render performance bottlenecks.
The basic React interaction model
In standard React, user interactions trigger event handlers that update state hooks (`useState`, `useReducer`), prompting React to re-render the virtual DOM and reconcile changes with the browser DOM. This model works well for forms, modals, and conditional visibility.
Why complex interactions outgrow boolean flags
When a component has multiple states (idle, hover, pressed, loading, success, error), relying on multiple boolean flags like `isLoading` and `isError` leads to impossible states—such as showing a spinner and an error banner simultaneously. Structuring interactive logic with finite state machines guarantees that a component can only ever be in one valid state at any moment.
Maintaining 60fps and passing INP
To keep React interactive UIs responsive and satisfy Google's Interaction to Next Paint (INP) metric:
- Never animate properties that trigger browser reflow or layout recalculation (`height`, `width`, `margin`, `top`).
- Stick strictly to GPU-accelerated properties: `transform` (translate, scale, rotate) and `opacity`.
- Offload high-frequency gesture calculations (touch drag, spring physics) outside of React's reconciliation cycle.
The runtime approach with ExodeUI
Writing complex spring kinematics, timeline tracks, and multi-state SVG morphs entirely in React JSX code is tedious and difficult to maintain. ExodeUI, which we make, lets teams design interactive UI visually in an editor, export an open .exode JSON file, and play it in React with our official npm package (`exodeui`).
Developers simply pass the compiled file to an `<ExodeCanvas>` component, bind inputs like `isPressed` or `stepIndex`, and listen to output events without writing hundreds of lines of imperative animation math.