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

Getting warning StyleSheet.compose(a, b) is deprecated; use array syntax, i.e., [a,b] for expo-web in nx-workspace without webpack. #457

Closed
1 of 5 tasks
pratish-respo opened this issue Nov 30, 2023 · 1 comment

Comments

@pratish-respo
Copy link

pratish-respo commented Nov 30, 2023

Current behavior

I am using react-native-safe-area-context package in my nx-workspace. In my workspace, I have mobile(react-native) & web(expo-web). When i run my web project with react-native-web version 0.19.6, I am getting a warning StyleSheet.compose(a, b) is deprecated; use array syntax, i.e., [a,b].
Screenshot from 2023-11-30 15-12-30

Expected behavior

Instead of using StyleSheet.compose in styles as below

style: StyleSheet.compose(styles.fill, style)

we have to use array syntax as below

style: [styles.fill, style]

This above change removes the warning in web.

Platform

  • Android
  • iOS
  • Web
  • Windows
  • MacOS

Environment

package version
react-native-safe-area-context 4.7.4
react-native 0.72.4
react-native-web 0.19.6
expo 49.0.20
node 16.20.0
npm 9.6.7
@jacobp100
Copy link
Collaborator

As far as I can tell, it's not deprecated by react-native, it looks like react-native-web is deprecating an API they don't own. Maybe you could file an issue with them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants