Skip to content

Commit

Permalink
feat: improve dummy WebView (react-native-webview#2509)
Browse files Browse the repository at this point in the history
* feat: improve dummy WebView

* Update WebView.tsx

Co-authored-by: Thibault Malbranche <malbranche.thibault@gmail.com>
  • Loading branch information
Simek and Titozzz authored May 29, 2022
1 parent 5067dc2 commit 2e79a03
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/WebView.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import React from 'react';
import { View } from 'react-native';
import { Text, View } from 'react-native';
import { IOSWebViewProps, AndroidWebViewProps, WindowsWebViewProps } from './WebViewTypes';

export type WebViewProps = IOSWebViewProps & AndroidWebViewProps & WindowsWebViewProps;

// This "dummy" WebView is to render something for unsupported platforms,
// like for example Expo SDK "web" platform. It matches the previous react-native
// implementation which is produced by Expo SDK 37.0.0.1 implementation, with
// similar interface than the native ones have.
// like for example Expo SDK "web" platform.
const WebView: React.FunctionComponent<WebViewProps> = () => (
<View style={{
alignSelf: 'flex-start',
borderColor: 'rgb(255, 0, 0)',
borderWidth: 1
}} />
<View style={{ alignSelf: 'flex-start' }}>
<Text style={{ color: 'red' }}>
React Native WebView does not support this platform.
</Text>
</View>
);

export { WebView };
export default WebView;
export default WebView;

0 comments on commit 2e79a03

Please sign in to comment.