-
Notifications
You must be signed in to change notification settings - Fork 167
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
Issue with css.defineVars
in React Native when using react-strict-dom
in monorepo
#260
Comments
css.defineVars
in React Native when using react-strict-dom
in mono repocss.defineVars
in React Native when using react-strict-dom
in monorepo
What does "not correctly" mean? I don't see any description of what the problem is. |
@necolas I'm sorry, it got lost in one of my edits. I updated the issue. But the problem we are facing is that the |
We use this API without issue at Meta. Your example code has various syntax errors, so I can't tell what problem you might be experiencing. Can you create a test case that reproduces the issue using Expo's snack UI, then share the link? |
Thanks for the response! I wanted to share some additional details: In our setup, I got everything working if react-native imports all components, tokens, and themes exclusively from the However, when we mix imports directly from both While debugging, I noticed that not all variables are present in the __customProperties) object . This seems to happen when multiple packages independently call I’ll work on creating a Snack later this week to better demonstrate the issue. Let me know if you have any advice or need more details in the meantime! |
Thanks, that's helpful. I better understand the issue. We don't have a package setup like this internally, so it's the kind of thing that could not be working correctly without us noticing. |
Describe the issue
We are using
react-strict-dom
in our React web app and React Native app, and everything works great in the web app. However, we are encountering issues in the React Native app when usingcss.defineVars
from our styling package. Interestingly, the issue seems to be resolved when using...css.props([])
instead ofstyle=[]
.We are bundling the app with Metro and have applied
unstable_enablePackageExports
to resolve potential export issues.App Structure:
Packages Folder:
Apps Folder:
Example (Simplified):
spacings.stylex.ts
(exported fromui-generated
):Gap.tsx
(exported fromui
):Issue:
css.create()
and passed throughstyle=[]
are not applied as expected (the height is undefined). Even though it works correctly in the web app....css.props([])
instead ofstyle=[]
, the issue is resolved in React Native.[warn] React Strict DOM: unrecognized custom property "--s16__id__202". This indicates that a custom CSS property is being used, but it's not recognized in React Strict DOM.
Any insight into why
style=[]
behaves differently in React Native would be greatly appreciated!Expected behavior
css.create
that usevars
should work correctly in both React and React Native when passed tostyle=[]
.Steps to reproduce
react-strict-dom
in both the React and React Native apps.css.create
to generate styles in theGap
component (as shown in the example).style=[]
.style=[]
with...css.props([])
and verify that the issue is resolved in React Native.Test case
No response
Additional comments
unstable_enablePackageExports
to resolve potential export issues.The text was updated successfully, but these errors were encountered: