Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.16.1] NativeWind classes not being applied on Animated.View #6665

Open
amandaharlin opened this issue Nov 4, 2024 · 2 comments
Open

[3.16.1] NativeWind classes not being applied on Animated.View #6665

amandaharlin opened this issue Nov 4, 2024 · 2 comments
Labels
Platform: Web This issue is specific to web Repro provided A reproduction with a snippet of code, snack or repo is provided

Comments

@amandaharlin
Copy link

amandaharlin commented Nov 4, 2024

Description

React-Native-Reanimated (at 3.10.1) was working with NativeWind to correctly apply classes to an Animated.View.

After upgrading Reanimated to 3.16.1 NW classnames were no longer getting applied to an Animated.View.

I opened a ticket with NativeWind too, so both teams could be notified.

Working Project Details Not-Working Project Details
Expo 52.0.0-preview.18 Expo 52.0.0-preview.18
React NativeReanimated 3.10.1 React NativeReanimated at 3.16.1
NativeWind at 4.1.21 NativeWind at 4.1.21
rnreanimated 3.10.1 rnreanimated 3.16.1
Screenshot 2024-11-04 at 10 18 46 AM Screenshot 2024-11-04 at 10 20 16 AM

Steps to reproduce

  1. Create a repo with npx create-expo-stack@latest --nativewind
  2. Upgrade Reanimated from 3.10.1 to 3.16.1
  3. Add classNames to an animated view. (Should work, but does not)
  4. Downgrade Reanimated to 3.10.1. (Works as expected)

Snack or a link to a repository

https://github.com/amandaharlin/react-native-reanimated-nativewind-classname-repro

Reanimated version

3.16.1

React Native version

0.76.1

Platforms

Web

JavaScript runtime

None

Workflow

Expo Go

Architecture

None

Build type

Debug app & dev bundle

Device

None

Device model

No response

Acknowledgements

Yes

@marklawlor
Copy link
Contributor

marklawlor commented Nov 4, 2024

I have no investigated this yet. But incase this is a reanimated issue, NativeWind on web works by passing a StyleQ precompiled styled object to the <View />.

<View style={{ $$css: true, myUniqueIdentifier: 'my-class' }} /> 

will output as 

<div class="my-class" />

@amandaharlin
Copy link
Author

Hey y'all, after checking 3.12, 3.14, and 3.15.5, I found that the change appeared in 3.16.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Web This issue is specific to web Repro provided A reproduction with a snippet of code, snack or repo is provided
Projects
None yet
Development

No branches or pull requests

2 participants