react-native-webview-window-declaration
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

react-native-webview-window-declaration

This package provides TypeScript declarations for an extended window object when using react-native-webview. It's designed to enhance type safety and developer experience by explicitly declaring the ReactNativeWebView property on the global window object.

Installation

To install the package, run the following command in your project directory:

npm install react-native-webview-window-declaration

Usage

Once installed, the TypeScript compiler will recognize the ReactNativeWebView property on the global window object in your React Native project. You do not need to import anything explicitly in your TypeScript files; the declaration is global.

Here's how you might use it in your project:

if (window.ReactNativeWebView) {
  window.ReactNativeWebView.postMessage("Hello from the web!");
}

License

Distributed under the MIT License. See LICENSE for more information.

Package Sidebar

Install

npm i react-native-webview-window-declaration

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

3.21 kB

Total Files

5

Last publish

Collaborators

  • softmarshmallow