Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

@snap-fill/react-native

React Native WebView adapter for @snap-fill/core, including a hook and a drop-in component.

Install

pnpm add @snap-fill/core @snap-fill/react-native react-native-webview

Usage

import { useRef } from 'react';
import WebView from 'react-native-webview';
import { useSnapfill } from '@snap-fill/react-native';

export function Checkout() {
  const ref = useRef<WebView>(null);
  const { injectedJavaScript, onMessage, fillForm } = useSnapfill(ref, {});

  return (
    <WebView
      ref={ref}
      source={{ uri: 'https://example.com/checkout' }}
      injectedJavaScript={injectedJavaScript}
      onMessage={onMessage}
    />
  );
}

Exports

  • useSnapfill
  • SnapfillWebView
  • parseSnapfillMessage
  • React Native adapter types plus re-exported core types

Development

pnpm --filter @snap-fill/react-native build
pnpm --filter @snap-fill/react-native test