Skip to main content
Version: v1

IFluidMountableView Interface

An IFluidMountableView provides a view bundled with a mounting mechanism. That view can be mounted and unmounted from a given element. This bundling of view + mounting mechanism is important for React, which needs the same React instance to be used for the mounting ReactDOM.render() call as the Fluid object it's mounting, or else React hooks don't work. This is the case in scenarios like webpack-fluid-loader, which attempts to do cross-bundle mounting.

This is not intended to be used as a general rendering/mounting approach, but rather as just a specific solution for cross-bundle mounting. General rendering/mounting should instead use the view adapters or make direct calls to framework-specific rendering APIs.

Signature

export interface IFluidMountableView extends IProvideFluidMountableView

Extends: IProvideFluidMountableView

Methods

Method Return Type Description
mount(container) void Mounts the view at the given element.
unmount() void Performs any necessary cleanup for the view and then removes it from the DOM.

Method Details

mount

Mounts the view at the given element.

Signature

mount(container: HTMLElement): void;

Parameters

Parameter Type Description
container HTMLElement the DOM parent of the view we will mount

unmount

Performs any necessary cleanup for the view and then removes it from the DOM.

Signature

unmount(): void;