UNPKG

@lifi/widget

Version:

LI.FI Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.

15 lines (12 loc) 427 B
import { useEffect } from 'react' import { useLocation } from 'react-router-dom' import { useWidgetEvents } from '../hooks/useWidgetEvents.js' import { WidgetEvent } from '../types/events.js' export function PageEntered() { const location = useLocation() const emitter = useWidgetEvents() useEffect(() => { emitter.emit(WidgetEvent.PageEntered, location.pathname) }, [emitter, location.pathname]) return null }