title: CustomWrapper

sidebar_label: CustomWrapper

custom-wrapper 自定义组件包裹器 当数据更新层级较深时,可用此组件将需要更新的区域包裹起来,这样更新层级将大大减少

支持情况:CustomWrapper - 图1 CustomWrapper - 图2 CustomWrapper - 图3 CustomWrapper - 图4 CustomWrapper - 图5 CustomWrapper - 图6 CustomWrapper - 图7 CustomWrapper - 图8 CustomWrapper - 图9

类型

  1. ComponentType<CustomWrapperProps>

示例代码

  1. import { Component } from 'react'
  2. import { CustomWrapper, View, Text } from '@tarojs/components'
  3. export default class C extends Component {
  4. render () {
  5. return (
  6. <View>
  7. <CustomWrapper>
  8. <Text>Hello, world!</Text>
  9. </CustomWrapper>
  10. </View>
  11. )
  12. }
  13. }

CustomWrapperProps