In-App UI
React
Components
KnockGuideLocationSensor
KnockGuideLocationSensor
A React helper component intended for use with select supported frameworks, such as Next.js and Tanstack Router, for detecting route changes.
Activation rules for guides are evaluated as user's location changes in your application, and KnockGuideProvider by default listens for location change events from the global window object (enabled via the trackLocationFromWindow prop).
However, modern frameworks often provide their own first class router API for detecting and reacting to route changes that can work better and more reliably. Note the import path specific to a corresponding framework, and also KnockGuideLocation must be placed inside KnockGuideProvider.