Describe the bug
nativewind v5 safearea is not working with className but working with style.
The className doesn’t work:
import { View } from 'react-native';
export default function () {
return (
<View className="pt-safe flex-1">
<View className="flex-1 bg-green-200" />
</View>
);
}
Only style works:
import { View } from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
export default function () {
const insets = useSafeAreaInsets();
return (
<View
style={{
paddingTop: insets.top,
flex: 1,
}}>
<View className="flex-1 bg-green-200" />
</View>
);
}
Reproduction
Expected behavior
The className pt-safe should padding top safearea.
Describe the bug
nativewind v5 safearea is not working with className but working with style.
The
classNamedoesn’t work:Only
styleworks:Reproduction
npx rn-new@next --nativewind.reproduction repo
Expected behavior
The className
pt-safeshould padding top safearea.