diff --git a/ReactViewResources/Loader/Internal/ComponentsRenderCache.ts b/ReactViewResources/Loader/Internal/ComponentsRenderCache.ts index f3932ae2..eef40cad 100644 --- a/ReactViewResources/Loader/Internal/ComponentsRenderCache.ts +++ b/ReactViewResources/Loader/Internal/ComponentsRenderCache.ts @@ -34,8 +34,9 @@ export function storeViewRenderInCache(view: ViewMetadata, cacheEntry: IRenderCa // cache view html for further use const elementHtml = view.root!.innerHTML; // get all stylesheets except the sticky ones (which will be loaded by the time the html gets rendered) otherwise we could be loading them twice + const stylesheets = getStylesheets(view.root!).filter(l => l.dataset.sticky !== "true").map(l => l.outerHTML).join(""); - + // the remaining code can be executed afterwards return new Promise(() => { // insert rendered html into the cache diff --git a/ReactViewResources/Loader/Internal/ViewPortal.tsx b/ReactViewResources/Loader/Internal/ViewPortal.tsx index 0e9f1757..2fc9fddc 100644 --- a/ReactViewResources/Loader/Internal/ViewPortal.tsx +++ b/ReactViewResources/Loader/Internal/ViewPortal.tsx @@ -9,7 +9,7 @@ export type ViewLifecycleEventHandler = (view: ViewMetadata) => void; export type ViewErrorHandler = (view: ViewMetadata, error: Error) => void; export interface IViewPortalProps { - view: ViewMetadata + view: ViewMetadata; viewMounted: ViewLifecycleEventHandler; viewUnmounted: ViewLifecycleEventHandler; viewErrorRaised: ViewErrorHandler; @@ -56,6 +56,7 @@ export class ViewPortal extends React.Component - {this.props.views.items.sort((a, b) => a.name.localeCompare(b.name)) - .map(view => this.renderViewPortal(view))} - - ); + public render(): React.ReactNode { + return this.props.views.items.sort((a, b) => a.name.localeCompare(b.name)).map(view => this.renderViewPortal(view)); } } \ No newline at end of file diff --git a/Sample.Avalonia/ExtendedReactViewFactory.cs b/Sample.Avalonia/ExtendedReactViewFactory.cs index 79324c0e..6a31a5f7 100644 --- a/Sample.Avalonia/ExtendedReactViewFactory.cs +++ b/Sample.Avalonia/ExtendedReactViewFactory.cs @@ -16,7 +16,7 @@ public override IViewModule[] InitializePlugins() { return new IViewModule[] { viewPlugin }; } - public override bool ShowDeveloperTools => false; + public override bool ShowDeveloperTools => true; public override bool EnableViewPreload => true;