Open daniellzl opened 1 year ago
I also have errors using <RollbarContext context="something">
with "react-router-dom": "6.11.2"
:
import { useRoutes } from 'react-router-dom';
return useRoutes([
{
path: `${Route.Foo}/:bar`,
element: (
<RollbarContext context="/foo-bar">
<FooBar />
</RollbarContext>
)
}
]);
cc @rollbar-bborsits (Juanjo Marrón suggested to ping you) to have a look at this 🙏
cc @waltjones
Hey @gazpachu @daniellzl, We'll need to analyze the proposed solution further. We'll get back to you.
Docs: https://docs.rollbar.com/docs/react#rollbarcontext-component
1 - RollbarContext requires the onRender prop
Calling
doesn't actually set Rollbar's context to 'home'. On further examination of the RollbarContext component, I saw I needed to add a
onRender
prop for it to work:This doesn't align with the docs linked above.
2 - RollbarContext type is incorrect
Given the requirement of the
onRender
prop,RollbarContext
's type is incomplete.