Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4c51d0a

Browse files
committed
fix: remove null from useHtmlIframeProps return signature (dead condition)
1 parent 52888c5 commit 4c51d0a

File tree

3 files changed

+13
-20
lines changed

3 files changed

+13
-20
lines changed

packages/iframe-plugin/docs/iframe-plugin.usehtmliframeprops.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Extract props for the HTMLIframe component from renderer function arguments. Thi
99
<b>Signature:</b>
1010

1111
```typescript
12-
export default function useHtmlIframeProps({ style, tnode }: CustomRendererProps<TBlock>, iframeConfig?: IframeConfig): HTMLIframeProps | null;
12+
export default function useHtmlIframeProps({ style, tnode }: CustomRendererProps<TBlock>, iframeConfig?: IframeConfig): HTMLIframeProps;
1313
```
1414

1515
## Parameters
@@ -21,5 +21,5 @@ export default function useHtmlIframeProps({ style, tnode }: CustomRendererProps
2121

2222
<b>Returns:</b>
2323

24-
[HTMLIframeProps](./iframe-plugin.htmliframeprops.md) \| null
24+
[HTMLIframeProps](./iframe-plugin.htmliframeprops.md)
2525

packages/iframe-plugin/etc/iframe-plugin.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const IframeRenderer: CustomBlockRenderer;
4949
export default IframeRenderer;
5050

5151
// @public
52-
export function useHtmlIframeProps({ style, tnode }: CustomRendererProps<TBlock>, iframeConfig?: IframeConfig): HTMLIframeProps | null;
52+
export function useHtmlIframeProps({ style, tnode }: CustomRendererProps<TBlock>, iframeConfig?: IframeConfig): HTMLIframeProps;
5353

5454

5555
// (No @packageDocumentation comment for this package)

packages/iframe-plugin/src/useHtmlIframeProps.ts

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const defaultIframeConfig: IframeConfig = {
3131
export default function useHtmlIframeProps(
3232
{ style, tnode }: CustomRendererProps<TBlock>,
3333
iframeConfig?: IframeConfig
34-
): HTMLIframeProps | null {
34+
): HTMLIframeProps {
3535
const {
3636
WebView,
3737
defaultWebViewProps,
@@ -89,20 +89,13 @@ export default function useHtmlIframeProps(
8989
})
9090
};
9191

92-
if (__DEV__ && !WebView) {
93-
console.warn(
94-
"@native-html/iframe-plugin: You must pass a WebView component from react-native-webview as a prop to the HTML component. The iframe won't be rendered."
95-
);
96-
}
97-
return WebView
98-
? {
99-
...resolvedConfig,
100-
source,
101-
onLinkPress,
102-
htmlAttribs,
103-
scaleFactor,
104-
style: [restStyle, { width: printWidth, height: printHeight }],
105-
WebView
106-
}
107-
: null;
92+
return {
93+
...resolvedConfig,
94+
source,
95+
onLinkPress,
96+
htmlAttribs,
97+
scaleFactor,
98+
style: [restStyle, { width: printWidth, height: printHeight }],
99+
WebView
100+
};
108101
}

0 commit comments

Comments
 (0)