Skip to content

[v14] TypeScript regression: every WebView prop errors with "not assignable to type 'never'" #3977

Description

@benadrasni

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-native-webview@14.0.1 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-webview/index.d.ts b/node_modules/react-native-webview/index.d.ts
index 10b9c14..626a67a 100644
--- a/node_modules/react-native-webview/index.d.ts
+++ b/node_modules/react-native-webview/index.d.ts
@@ -5,7 +5,7 @@ export { FileDownload, WebViewMessageEvent, WebViewNavigation } from './lib/WebV
 
 export type WebViewProps = IOSWebViewProps & AndroidWebViewProps & WindowsWebViewProps;
 
-declare class WebView<P = undefined> extends Component<WebViewProps & P> {
+declare class WebView<P = {}> extends Component<WebViewProps & P> {
   /**
    * Go back one page in the webview's history.
    */

This issue body was partially generated by patch-package.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions