Skip to content

Commit

Permalink
fix: add webviewBaseURL
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySerfaty committed Feb 18, 2024
1 parent 2a26c1e commit 8793909
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/RichText/RichText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const RichText = ({ editor, ...props }: RichTextProps) => {
const { keyboardHeight: iosKeyboardHeight, isKeyboardUp } = useKeyboard();
const source: WebViewProps['source'] = editor.DEV
? { uri: editor.DEV_SERVER_URL || DEV_SERVER_URL }
: { html: editor.customSource || editorHtml };
: { html: editor.customSource || editorHtml, uri: editor.webviewBaseURL };

const onWebviewMessage = (event: WebViewMessageEvent) => {
const { data } = event.nativeEvent;
Expand Down
2 changes: 2 additions & 0 deletions src/RichText/useEditorBridge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const useEditorBridge = (options?: {
autofocus?: boolean;
avoidIosKeyboard?: boolean;
customSource?: string;
webviewBaseURL?: string;
DEV?: boolean;
DEV_SERVER_URL?: string;
theme?: RecursivePartial<EditorTheme>;
Expand Down Expand Up @@ -82,6 +83,7 @@ export const useEditorBridge = (options?: {
autofocus: options?.autofocus,
avoidIosKeyboard: options?.avoidIosKeyboard,
customSource: options?.customSource,
webviewBaseURL: options?.webviewBaseURL,
DEV_SERVER_URL: options?.DEV_SERVER_URL,
DEV: options?.DEV,
webviewRef,
Expand Down
1 change: 1 addition & 0 deletions src/types/EditorBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface BridgeState {}
export interface EditorBridge {
avoidIosKeyboard?: boolean;
customSource?: string;
webviewBaseURL?: string;
DEV?: boolean;
DEV_SERVER_URL?: string;
autofocus: boolean;
Expand Down

0 comments on commit 8793909

Please sign in to comment.