Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 701 Bytes

OnUpdate.md

File metadata and controls

30 lines (21 loc) · 701 Bytes

OnUpdate <>

The <OnUpdate> component will be called whenever the location changes.

Usage

call

A function to be called whenever the location changes. The function will be passed the new location object.

import { OnUpdate } from 'rrc'

<OnUpdate
  call={(location) => {
    analyticsTool.log(location.pathname)
  }} />

immediate

A boolean attribute, if true, the call prop will be called when the <OnUpdate> component mounts.

<OnUpdate
  immediate
  call={(location) => {
    analyticsTool.log(location.pathname)
  }} />