rollbar / rollbar-react

React features to enhance using Rollbar.js in React Applications
https://docs.rollbar.com/docs/react
MIT License
42 stars 10 forks source link

historyContext: incomplete/outdated information #73

Closed jacquesg closed 3 weeks ago

jacquesg commented 2 years ago

historyContext does not return something that can be used with history.listen().

export function historyContext(
  rollbar: Rollbar,
  args: {
    formatter: (location: string, action: string) => string;
    filter: (location: string, action: string) => boolean;
  }
): (
  v4Location: {
    action: string;
    filter: (location: string, action: string) => boolean;
  },
  v4action: string
) => void;
jacquesg commented 2 years ago

The documentation also states: "The signature is filter(location, action): Boolean where location is history.location and action is history.action."

However, from the above the location type is a string.

jacquesg commented 2 years ago

The example usage: history.listen(historyContext(rollbar)); also doesn't work, as the args parameter is not optional.