-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Labels
bugSomething isn't workingSomething isn't working
Description
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
- creating new projects with
npx rn-new@next --nativewind.
reproduction repo
Expected behavior
The className pt-safe should padding top safearea.
alenvuletic
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
Todo