/**
* React Integration Examples for InAppBrowserEscaper
*
* This file contains example code for integrating InAppBrowserEscaper with React.
* To use these examples, install React as a dependency in your project.
*
* npm install react react-dom
* npm install -D @types/react @types/react-dom
*/
/*
// Example 1: Using the hook
import React from 'react';
import { useInAppBrowserEscaper } from '@jhrunning/inappbrowserescaper/react';
function MyComponent() {
const { isInApp, browserInfo, escapeFromInApp, copyUrl } = useInAppBrowserEscaper();
if (isInApp) {
return (
You're browsing in {browserInfo?.appName}
);
}
return
You're in a regular browser!
;
}
// Example 2: Using the provider
import React from 'react';
import { InAppBrowserEscaperProvider } from '@jhrunning/inappbrowserescaper/react';
function App() {
return (
{
console.log('In-app browser detected:', browserInfo);
}}
>
);
}
// Example 3: Using the escape button component
import React from 'react';
import { EscapeButton } from '@jhrunning/inappbrowserescaper/react';
function Header() {
return (
My Website
🌐 Open in Browser
);
}
*/
// Note: Uncomment the examples above to use them in your React project