rollbar-react icon indicating copy to clipboard operation
rollbar-react copied to clipboard

historyContext: incomplete/outdated information

Open jacquesg opened this issue 3 years ago • 2 comments
trafficstars

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 avatar Nov 15 '22 12:11 jacquesg

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 avatar Nov 15 '22 12:11 jacquesg

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

jacquesg avatar Nov 15 '22 12:11 jacquesg