Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Get React Native View width and height

import React from 'react'
import { View } from 'react-native'

export default function index() {
  const onLayout=(event)=> {
    const {x, y, height, width} = event.nativeEvent.layout;
    
  }
  return (
    <View onLayout={onLayout}>
      <OtherComponent />
    </View>
  )
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Get #React #Native #View #width #height
ADD COMMENT
Topic
Name
6+4 =