onEvent

Sets the callback function to be invoked when a navigation event occurs.

Parameters

callback

The callback function to handle navigation events.