From 20a3f90c0f0b24c59ab6b31dc981e9e4f1c0473b Mon Sep 17 00:00:00 2001 From: Kai Guo Date: Fri, 15 May 2020 15:34:55 -0700 Subject: [PATCH] fix(windows): Fix windows local asset path (#1335 by @kaiguo) [skip ci] --- docs/Guide.md | 2 +- example/App.tsx | 14 ++++++++ example/assets/test.html | 9 +++++ example/examples/LocalPageLoad.tsx | 16 +++++++++ .../ReactWebViewManager.cpp | 15 ++++---- yarn.lock | 36 ++----------------- 6 files changed, 49 insertions(+), 43 deletions(-) create mode 100644 example/assets/test.html create mode 100644 example/examples/LocalPageLoad.tsx diff --git a/docs/Guide.md b/docs/Guide.md index c7f022d..8d2a842 100644 --- a/docs/Guide.md +++ b/docs/Guide.md @@ -55,7 +55,7 @@ class MyWeb extends Component { ### Loading local HTML files -Sometimes you would have bundled an HTML file along with the app and would like to load the HTML asset into your WebView. To do this on iOS, you can just import the html file like any other asset as shown below. +Sometimes you would have bundled an HTML file along with the app and would like to load the HTML asset into your WebView. To do this on iOS and Windows, you can just import the html file like any other asset as shown below. ```js import React, { Component } from 'react'; diff --git a/example/App.tsx b/example/App.tsx index 796420f..6322382 100644 --- a/example/App.tsx +++ b/example/App.tsx @@ -16,6 +16,7 @@ import Background from './examples/Background'; import Downloads from './examples/Downloads'; import Uploads from './examples/Uploads'; import Injection from './examples/Injection'; +import LocalPageLoad from './examples/LocalPageLoad'; const TESTS = { Alerts: { @@ -66,6 +67,14 @@ const TESTS = { return ; }, }, + PageLoad: { + title: 'LocalPageLoad', + testId: 'LocalPageLoad', + description: 'Local Page load test', + render() { + return ; + }, + }, }; type Props = {}; @@ -124,6 +133,11 @@ export default class App extends Component { title="Injection" onPress={() => this._changeTest('Injection')} /> +