ui/ Placeholder
Exports the ui/Placeholder.PlaceholderControllerDecorator and ui/Placeholder.PlaceholderDecorator higher-order components.
The default export is PlaceholderDecorator.
import Placeholder from '@enact/ui/Placeholder';
Members
PlaceholderControllerDecoratorHigher-Order Component
A higher-order component (HOC) that render placeholder components.
Components are rendered based on their position relative to the 'scrollTop'
from the
'onScroll'
's parameter. They are not unmounted once rendered.
import {PlaceholderControllerDecorator} from '@enact/ui/Placeholder';
Configuration
The bounds of the container represented by an object with
height
andwidth
members.If the container is a static size, this can be specified at design-time to avoid calculating the bounds at run-time (the default behavior).
Default: nullEvent callback which indicates that the viewport has scrolled and placeholders should be notified.
Default: onScrollMultiplier used with the wrapped component's height and width to determine the threshold for replacing the placeholder component with the true component.
Default: 1.5
PlaceholderDecoratorHigher-Order Component
A higher-order component that enables a container to notify the wrapped component when scrolling.
Containers must provide registerPlaceholder
, unregisterPlaceholder
, and invalidateBounds
methods via React's context for PlaceholderDecorator
instances.
No additional properties are passed to the wrapped component.
import {PlaceholderDecorator} from '@enact/ui/Placeholder';
Configuration
Configures the style of the placeholder element
Default: {height: 0, width: 'auto'}The component to use as a placeholder.
Default: 'div'