forked from react-native-webview/react-native-webview
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve dummy WebView (react-native-webview#2509)
* feat: improve dummy WebView * Update WebView.tsx Co-authored-by: Thibault Malbranche <malbranche.thibault@gmail.com>
- Loading branch information
Showing
1 changed file
with
8 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |