Skip to content

React + React Native compatibility #1109

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

Merged
merged 3 commits into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
build:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [8, 10, 12, 14, 16]
Expand Down
4 changes: 4 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ declare class Rollbar {

public errorHandler(): Rollbar.ExpressErrorHandler;

// Used with rollbar-react for rollbar-react-native compatibility.
public rollbar: Rollbar;

// Exposed only for testing, should be changed via the configure method
// DO NOT MODIFY DIRECTLY
public options: Rollbar.Configuration;
Expand All @@ -49,6 +52,7 @@ declare namespace Rollbar {
addErrorContext?: boolean;
addRequestData?: (data: Dictionary, req: Dictionary) => void;
autoInstrument?: AutoInstrumentOptions;
captureDeviceInfo?: boolean;
captureEmail?: boolean;
captureIp?: boolean | "anonymize";
captureLambdaTimeouts?: boolean;
Expand Down
3 changes: 3 additions & 0 deletions src/browser/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ function Rollbar(options, client) {
this.instrumenter.instrument();
}
_.setupJSON(polyfillJSON);

// Used with rollbar-react for rollbar-react-native compatibility.
this.rollbar = this;
}

var _instance = null;
Expand Down