octopitus / rn-sliding-up-panel

Draggable sliding up panel implemented in React Native https://octopitus.github.io/rn-sliding-up-panel/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to get current height of child View layout?

xfishernet opened this issue · comments

How to get current height of child View layout?

const Example = () => {
  const [viewHeight, setViewHeight] = useState(null);

  const onViewLayout = event => {
    setViewHeight(event.nativeEvent.layout.height);
  }

  return (
    <SlidingUpPanel>
      <View onLayout={onViewLayout}>
        <Text>The hight of View is {viewHeight} pixels.</Text>
      </View>
    </SlidingUpPanel>
  );
}