| name | LazyComponent |
| description | Provide the information about the `<LazyComponent>`. Show the common use cases, basic usage, and critical development Advises. |
lynx-ui-lazy-component SKILL
<LazyComponent> is a component that lazy loads the content when it is visible in the viewport.
1. Common Use Cases
- Offscreen rendering in scrollable containers: Display the content of the page only when it is visible in the viewport of scrollable containers such as
<ScrollView>, <List>, <FeedList>, etc. Usually used for speed up the initial loading time.
- Virtualized List: Embed
<LazyComponent> in the slot of <ScrollView> so that the content of the items are only loaded when they are visible in the viewport.
2. Basic Usage
<LazyComponent> is used to display the content of the page only when it is visible in the viewport.
import { LazyComponent } from '@lynx-js/lynx-ui'
function App() {
return (
<view>
<LazyComponent
scene={'scene'}
pid={'pid'}
= '', '' }}
>
)
}