Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<RollbarContext /> implementation doesn't match docs #88

Open
daniellzl opened this issue Mar 8, 2023 · 4 comments
Open

<RollbarContext /> implementation doesn't match docs #88

daniellzl opened this issue Mar 8, 2023 · 4 comments

Comments

@daniellzl
Copy link

Docs: https://docs.rollbar.com/docs/react#rollbarcontext-component

1 - RollbarContext requires the onRender prop

Calling

<RollbarContext context="home"></RollbarContext>

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:

<RollbarContext context="home" onRender></RollbarContext>

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.

@gazpachu
Copy link

gazpachu commented Jun 19, 2023

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>
  )
}
]);
Screenshot 2023-06-19 at 11 45 15

@gazpachu
Copy link

cc @rollbar-bborsits (Juanjo Marrón suggested to ping you) to have a look at this 🙏

@gazpachu
Copy link

cc @waltjones

@ghost
Copy link

ghost commented Aug 1, 2023

Hey @gazpachu @daniellzl, We'll need to analyze the proposed solution further. We'll get back to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants