rollbar-react
rollbar-react copied to clipboard
historyContext: incomplete/outdated information
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;
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.
The example usage: history.listen(historyContext(rollbar)); also doesn't work, as the args parameter is not optional.