I'm trying to merge an existing style with my extra styling in React Native's regular StyleSheet.create method:
const styles = StyleSheet.create({
blurView:{
...StyleSheet.absoluteFill,
borderRadius: 24
},
});
However I'm getting the following error on line ...StyleSheet.absoluteFill:
Spread types may only be created from object types.
What am I doing wrong? I know I can pass an array into style prop, but I'm just curious why this isn't working.
Changing StyleSheet.absoluteFill to StyleSheet.absoluteFillObject fixed the issue. Apparently spread operator doesn't play well with registered styles.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With