rollbar / rollbar/rollbar-react
TypeScript types don't match implementation
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 46
- Forks
- 9
- Avg merge
- 2d 56m
- Merged PRs (30d)
- 4
Description
Currently, the TypeScript type definitions do not match the documentation nor the implementation. Here are the problems I've encountered so far in one afternoon of integrating the library:
<ErrorBoundary>has afallbackUIprop, which is aReactNode(the result of rendering a component) in types, but is assumed to be a function (a functional component) in the implementation. The correct type would most likely beReact.ComponentType<{}>orReact.FC<{}>.historyContexthas multiple issues:- The documentation (and implementation) claims to support both History v4 and History v5, but the types are only compatible with V4.
filterandformatterfunctions receivelocationas a string, but it is in fact aLocationobject, not a string.filterandformatterare documented as optional, but they are required arguments in types.- Furthermore, the types are not correct even for V4:
- The function returns a callback which receives an object consisting of
actionandfilter, but this seems like a copy-paste mistake and the correct signature is probably(location: Location, action: string). - You need to define your own
Locationtype, unless you want to take a dependency onhistory.
- The function returns a callback which receives an object consisting of
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing index.d.ts with src/error-boundary.js and src/history-context.js, then check the linked documentation and implementation references for the supported signatures. Align fallbackUI and historyContext types with the documented and implemented behavior, including optional arguments and History v4/v5 compatibility. Done means the declarations no longer contradict those sources.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react, typescript
- Domain
- api, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100