// import { View } from "@tarojs/components";
import { useLayoutEffect, useRef, useState } from "react";
import { LayoutChangeEvent, View } from "react-native";

export default function DemoA(props:{ children}) {
    const [height, setHeight] = useState<number>(1000000);

    const handleLayout = (event: LayoutChangeEvent) => {
        console.log('oppsu1111')
        const { height } = event.nativeEvent.layout;
        console.log(height)
        setHeight(height);
    };
    //onLayout={handleLayout}

    return (
        <View style={{  backgroundColor: 'blue', height:height,width:200 }} >
            <View onLayout={handleLayout}>

            
            {props.children}
            </View>
        </View>
    );
}