diff --git a/plugins/techdocs/src/reader/components/Reader.tsx b/plugins/techdocs/src/reader/components/Reader.tsx index 3e840aacbc..e474d3bf11 100644 --- a/plugins/techdocs/src/reader/components/Reader.tsx +++ b/plugins/techdocs/src/reader/components/Reader.tsx @@ -146,13 +146,13 @@ export const Reader = () => { ]); }, [componentId, path, shadowRoot, state]); // eslint-disable-line react-hooks/exhaustive-deps - if (state.value instanceof Error) return ; + if (state.value instanceof Error) { + return ; + } return ( - <> - -
- - + +
+ ); }; diff --git a/plugins/techdocs/src/reader/transformers/onCssReady.ts b/plugins/techdocs/src/reader/transformers/onCssReady.ts index 970f7cbe7c..2d355574b6 100644 --- a/plugins/techdocs/src/reader/transformers/onCssReady.ts +++ b/plugins/techdocs/src/reader/transformers/onCssReady.ts @@ -18,19 +18,19 @@ import type { Transformer } from './index'; type OnCssReadyOptions = { docStorageURL: string; - onCssLoading: (dom: Element) => void; - onCssReady: (dom: Element) => void; + onLoading: (dom: Element) => void; + onLoaded: (dom: Element) => void; }; export const onCssReady = ({ docStorageURL, - onLoad, - onReady, + onLoading, + onLoaded, }: OnCssReadyOptions): Transformer => { return dom => { const cssPages = Array.from( dom.querySelectorAll('head > link[rel="stylesheet"]'), - ).filter(elem => elem.getAttribute('href').startsWith(docStorageURL)); + ).filter(elem => elem.getAttribute('href')?.startsWith(docStorageURL)); let count = cssPages.length; @@ -43,9 +43,11 @@ export const onCssReady = ({ count -= 1; if (count === 0) { - onReady(dom); + onLoaded(dom); } }), ); + + return dom; }; };