Open anton-patrushev opened 2 months ago
I see types are moved to /index.d.ts ( better approach imho) , but index.d.ts
is referencing ./lib/WebViewTypes
which are pure js files without any type info. probably some ts build config issue, i am looking into permanent fix , meanwhile you can try below patch
diff --git a/node_modules/react-native-webview/index.d.ts b/node_modules/react-native-webview/index.d.ts
index 394b444..1cc0753 100644
--- a/node_modules/react-native-webview/index.d.ts
+++ b/node_modules/react-native-webview/index.d.ts
@@ -1,8 +1,8 @@
import { Component } from 'react';
// eslint-disable-next-line
-import { IOSWebViewProps, AndroidWebViewProps, WindowsWebViewProps } from './lib/WebViewTypes';
+import { IOSWebViewProps, AndroidWebViewProps, WindowsWebViewProps } from './src/WebViewTypes';
-export { FileDownload, WebViewMessageEvent, WebViewNavigation } from "./lib/WebViewTypes";
+export { FileDownload, WebViewMessageEvent, WebViewNavigation } from "./src/WebViewTypes";
export type WebViewProps = IOSWebViewProps & AndroidWebViewProps & WindowsWebViewProps;
PR #3378 will fix typings , sourceMaps are still not linked let me know if sourcemap is required
Works in 2.8.6, this can probably be closed.
Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically
Bug description: Both the latest (at the moment)
13.8.4
and13.8.3
versions have broken TypeScript support. Props are not typified on these versions.To Reproduce:
install
13.8.4
or13.8.3
into TS configured projectI noticed that it doesn't have
.d.ts
files for eachjs
file undernode_modules/react-native-webview/lib/
folderHere is what it looks like on
13.8.4
And it leads to issues like this:
Expected behavior:
It should have working TS support. So it should have TS support for
WebView
props.Screenshot from the
13.8.2
version:I believe it should have
.d.ts
file for each file undernode_modules/react-native-webview/lib/
folder:Screenshot from the
13.8.2
version:Environment:
iOS
(local machine — MacOS Sonoma 14.4.1)iOS 17.4
0.72.12
(Fabric enabled)13.8.4