When run this code I get error:
JSON value "of type NSString cannot be converted to a ABI46_0_0YGValue. Did you forger the % or pt suffix?
But why? How should change the code to stop the error?
import { Text, View} from 'react-native';
import {useState} from 'react'
export default function App() {
const [height, setHeight] = useState('')
return (
<View style={{
backgroundColor: 'green',
flex: 1
}}>
<View style={{
backgroundColor: 'blue',
position: 'absolute',
left: 0,
right: 0,
top: 0,
bottom: height,
}}>
</View>
<View
onLayout={({ nativeEvent }) => {
const { x, y, width, height } = nativeEvent.layout
setHeight(height)
}}
style={{
backgroundColor: 'red',
position: 'absolute',
left: 0,
right: 0,
bottom: 0,
padding: 20
}}>
<Text>Lorem Ipsum</Text>
</View>
</View>
);
}