Skip to content

Latest commit

 

History

History
60 lines (53 loc) · 1.54 KB

View.md

File metadata and controls

60 lines (53 loc) · 1.54 KB

Component View mapping lvgl Base object (lv_obj)

Api

Props

Usage

import { View, EAlignType, Button, Text } from 'lvlgjs-ui'
import { useRef, useEffect } from 'react'

function Component () {
    const ref = useRef()
    useEffect(() => {
        console.log(ref.current.style.left)
    })

    return (
       <View
          style={style.view}
          onPressedStyle={style.viewPressed}
          onClick={e => { e.stopPropagation() }}
          onPressed={() => {}}
          onLongPressed={() => {}}
          onLongPressRepeat={() => {}}
          align={{
              type: EAlignType.ALIGN_CENTER,
              pos: [10, 0]
          }}
          ref={ref}
      >
          <Button>
              <Text>2222</Text>
          </Button>
      </View>
    )
}

const style = {
    view: {},
    viewPressed: {}
}