Skip to content

Native wind integration is applying only for project but not for library components #771

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

Closed
2 tasks done
ursnj opened this issue Feb 19, 2025 · 5 comments
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@ursnj
Copy link

ursnj commented Feb 19, 2025

Description

While im trying to create some reusable components with nativewind library.

Native wind styles are applying for example project but not for library components.

I just created project here please have a look: https://github.com/ursnj/react-native-nayan

Packages

  • create-react-native-library
  • react-native-builder-bob

Selected options

Simple Javascript library

Link to repro

https://github.com/ursnj/react-native-nayan

Environment

Android and IOS

@ursnj ursnj added the bug Something isn't working label Feb 19, 2025
@ursnj
Copy link
Author

ursnj commented Feb 20, 2025

Anybody there ?

@atlj
Copy link
Collaborator

atlj commented Feb 24, 2025

@ursnj I think this is a tricky case since nativewind needs a babel preset and changes to your metro config https://www.nativewind.dev/getting-started/installation#3-add-the-babel-preset. Needs further investigation but I'd start looking there.

@ursnj
Copy link
Author

ursnj commented Mar 7, 2025

@atlj added all the recomended config unfortunatly no luck.

@edoko
Copy link

edoko commented Apr 10, 2025

@atlj added all the recomended config unfortunatly no luck.@atlj는 불행히도 모든 권장 구성을 추가했지만 운이 없었습니다.

Have you solved the problem?
I'm creating a internal ui library using nativewind and react-native-web, but after packaging and adding it to Storybook for use, it displays well on the web.
But, the style is not applied in the native app.

@ursnj
Copy link
Author

ursnj commented Apr 18, 2025

I managed to solve the issue with few config changes, checkout my complete component library for react-native

https://github.com/ursnj/react-native-nayan

@ursnj ursnj closed this as completed Apr 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants