Skip to content

Commit 9b44af4

Browse files
vladKrkvladkrk
and
vladkrk
authored
fix(view): setupRuntimeConfig is not a function on old html-extension peer (#685)
Co-authored-by: vladkrk <[email protected]>
1 parent 166e78c commit 9b44af4

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/view/hocs/withYfmHtml/index.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export type WithYfmHtmlBlockOptions = {
1515
export type WithYfmHtmlBlockProps = {
1616
meta: TransformMeta;
1717
yfmHtmlBlockConfig?: IHTMLIFrameElementConfig;
18+
/** Works only with html-extension dep version 2.7.1 and higher */
1819
htmlRuntimeConfig?: HTMLRuntimeConfig;
1920
};
2021

src/view/hocs/withYfmHtml/useYfmHtmlBlockRuntime.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ export function useYfmHtmlBlockRuntime(
1010
htmlRuntimeConfig: HTMLRuntimeConfig = {},
1111
) {
1212
if (meta?.script?.includes(runtime)) {
13-
setupRuntimeConfig(htmlRuntimeConfig);
13+
// MAJOR: update html-extension peer on ^2.7.1 and remove optional chain
14+
setupRuntimeConfig?.(htmlRuntimeConfig);
1415
import(/* webpackChunkName: "yfm-html-runtime" */ '@diplodoc/html-extension/runtime');
1516
}
1617
}

0 commit comments

Comments
 (0)