Skip to content

Typescript refuses to recognize a second argument for Linking.openUrl #2795

@maxgenest

Description

@maxgenest

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

In the documentation it is said that Linking.openUrl accepts a second argument for the target.
It is working but Typescript throw an error expected 1 argument but got 2

My code :

const goToRoute = (route: string) => {void Linking.openUrl(route, '_self')}

Expected behavior

Typescript should not throw an error when we use the target argument of Linking.openUrl

Steps to reproduce

  • react-native-web 0.21.0
  • react-native 0.76.9
  • typescript 5.8.3

Test case

https://codesandbox.io/p/devbox/hkcf2n?file=/App.tsx:6,13

Additional comments

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions