I'm trying to use RollbarContext and it's giving me an error on its componentDidMount function as it's trying to access rollbar.options.payload.context (see here). Looking at the rollbar.options object, there's no payload.
This is how I'm using the <RollbarContext>:
const rollbarConfig = {
accessToken: '<token>',
environment: 'testenv',
};
...
<Provider config={rollbarConfig}>
<ErrorBoundary>
<Router>
<Route path={rootPath}>
<Switch>
{Object.entries(routes).map(([path, route]) => {
return (
<RollbarContext context={path}>
<LazyRoute ... />
</RollbarContext>
);
})}
<Redirect from="*" to="/app/404" />
</Switch>
</Route>
</Router>
</ErrorBoundary>
</Provider>
I'm using the following versions of the libraries:
rollbar@2.26.2
@rollbar/react@0.11.2
I'm trying to use
RollbarContextand it's giving me an error on itscomponentDidMountfunction as it's trying to accessrollbar.options.payload.context(see here). Looking at therollbar.optionsobject, there's nopayload.This is how I'm using the
<RollbarContext>:I'm using the following versions of the libraries:
rollbar@2.26.2@rollbar/react@0.11.2