Skip to content

className not applied on Animated.createAnimatedComponent(Pressable) — HeroUI Native Button unstyled #510

@akouta527

Description

@akouta527

What happened?

HeroUI Native components that use Animated.createAnimatedComponent(Pressable) (Button, Switch, Checkbox) render completely unstyled with Uniwind Pro 1.1.0. The className prop is not being translated into React Native styles on animated Pressable components.

Regular Pressable and View components with the exact same Tailwind classes render correctly. Theme colors resolve properly via useThemeColor(). Non-animated HeroUI components (Surface, Card, Alert, Separator, Chip) render with full styling.

Proof:

  • Manual <Pressable className="bg-accent h-[48px] px-4 rounded-3xl"> → ✅ renders styled
  • HeroUI <Button variant="primary"> (uses AnimatedPressable internally) → ❌ renders as plain text
  • Both use identical classes: bg-accent h-[48px] px-4 gap-2 rounded-3xl flex-row items-center justify-center

This was tested on a fresh Expo 54 project (not a monorepo) with heroui-native@1.0.2.

Steps to Reproduce

  1. Create fresh Expo app: npx create-expo-app@latest test --template blank-typescript
  2. Install heroui-native and peer deps per Quick Start docs
  3. Install Uniwind Pro: "uniwind": "npm:uniwind-pro@^1.1.0" + react-native-nitro-modules
  4. Configure metro.config.js with withUniwindConfig (outermost wrapper)
  5. Configure global.css with @import 'heroui-native/styles' and @source './node_modules/heroui-native/lib'
  6. Add babel.config.js with react-native-worklets/plugin
  7. Wrap app with GestureHandlerRootView + HeroUINativeProvider
  8. Add both a manual Pressable with className="bg-accent h-[48px] px-4 rounded-3xl" and a HeroUI <Button variant="primary"><Button.Label>Test</Button.Label></Button>
  9. Run npx expo prebuild --clean && npx expo run:ios
  10. Manual Pressable is styled, HeroUI Button is plain text

Snack or Repository Link (Optional)

No response

Uniwind version

1.1.0

React Native Version

0.81.5

Platforms

iOS

Expo

Yes

Additional information

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions