Skip to content

Safe-area insets utility classes not working #234

Description

@xhanl

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.

Activity

  1. danstepanov commented on Nov 26, 2025

    @danstepanov
    Member

    I've created a minimal repro here and have flagged this to Mark https://github.com/danstepanov/safe-area-insets-bug

  2. moved this to Todo in Roadmapon Nov 26, 2025
  3. changed the title [-]V5 Safearea className not work[/-] [+]Safe-area insets utility classes not working[/+] on Nov 26, 2025
  4. moved this from Todo to In Progress in Roadmapon Feb 22, 2026
  5. moved this from In Progress to Done in Roadmapon Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions