Skip to content

Commit

Permalink
Added the changes to master docs
Browse files Browse the repository at this point in the history
  • Loading branch information
imabp authored Sep 16, 2020
1 parent f4f486e commit 1452afc
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions website/docs/docusaurus-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,25 @@ const MyComponent = () => {
};
```

### `onRouteUpdate({location})`

Set the page field to current location on the default tracker, such that subsequent hits on this page are attributed to this page.
Recommended for Single-page Applications.

Usage example:

```jsx {2,5,6,7}
import React from 'react';
import {onRouteUpdate} from '@docusaurus/useGlobalData';

const MyComponent = () => {
const location = { pathname:'./example.html' };

onRouteUpdate({location});
return <div>Page value set to {location.pathname}</div>;
};
```

## Modules

### `ExecutionEnvironment`
Expand Down

0 comments on commit 1452afc

Please sign in to comment.