question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React Navigation Plugin in TypeScript

See original GitHub issue

Description

When installing the React Navigation plugin in a TypeScript project it fails to typecheck const { createNavigationContainer } = Bugsnag.getPlugin('reactNavigation')

TS2339: Property 'createNavigationContainer' does not exist on type 'BugsnagPluginReactNavigationResult | undefined'.

Describe the solution you’d like

Better typings in the package or some docs on how to workaround

https://docs.bugsnag.com/platforms/react-native/react-native/navigation-libraries/ https://github.com/bugsnag/bugsnag-js/blob/next/packages/plugin-react-navigation/react-navigation.js

    "@bugsnag/plugin-react-navigation": "^7.10.0",
    "@bugsnag/react-native": "^7.10.5",

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
henrymoultoncommented, Jul 21, 2021

Thanks @johnkiely1 that’s not an ideal workaround I think for now I’m going to avoid Bugsnag plugins and just replicate the functionality.

Feedback is: I’m a big fan of your SDK and bring it to every client I can, but just feel like the docs/work around plugins (at least for React Native) doesn’t feel like it has the polish of other React Native specific things that you guys support e.g. CodePush.

Another example but separate issue is Jest Mocking / TypeScript support for the the .createErrorBoundary plugin

   TypeError: Cannot read property 'createErrorBoundary' of undefined

      21 | };
      22 | export const AppProviders = () => {
    > 23 |   const ErrorBoundary = Bugsnag.getPlugin("react").createErrorBoundary(React);

Obviously separate issue but just wanted to illustrate that it feels like plugins could be super useful but lack a bit of love.

Don’t worry my love for Bugsnag endures ❤️

0reactions
henrymoultoncommented, Oct 12, 2021

@xander-jones going to continue discussion in #1112.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Type checking with TypeScript - React Navigation
React Navigation is written with TypeScript and exports type definitions for TypeScript projects. Type checking the navigator​. To type check our route name...
Read more >
@bugsnag/plugin-react-navigation - npm
Integrates with the React Navigation library to provide better error context and navigation breadcrumbs. License. This package is free software ...
Read more >
How to add drawer and stack navigation with TypeScript in ...
In this tutorial we are going to implement react navigation with typescript.
Read more >
Working with Stack Navigation in React Native with Typescript
npm install @react-navigation/native. There are some extra dependencies for Expo Managed Project · expo install react-native-screens react-native-safe-area- ...
Read more >
React Native Bottom Navigation Error using TypeScript
I just downgrade these packages version and the issue is resolved. Here is my downgrade version: "@react-navigation/bottom-tabs": "5.11.11", ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found