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

I started to get a UI API called from a background thread: Queue name: com.facebook.react.ShadowQueue, #511

Closed
ospfranco opened this issue Jul 21, 2020 · 5 comments
Labels
Area: PlatformColor bug Something isn't working question Further information is requested

Comments

@ospfranco
Copy link

Hi, I need a bit of support here, I'm not sure if I did something, but I think I didn't besides updating the package to the latest versions, and all of the sudden I started getting this warning on app start:

Screenshot 2020-07-21 at 20 26 45 (2)

I already combed through my app code, I'm sure I'm not using shadows anywhere, and the error is there any time I use a component, any idea of how to get rid of this?

@ospfranco ospfranco added the question Further information is requested label Jul 21, 2020
@ghost ghost added the Needs: Triage 🔍 label Jul 21, 2020
@tom-un
Copy link
Collaborator

tom-un commented Jul 21, 2020

Hi @ospfranco: it is a legitimate bug in the repo that we make this UI Thread checker assert if a RCTDynamicColor is used. But it should only be encountered if a color prop is assigned a dynamic value, e.g. color: { dynamic: { light: 'black', dark: 'white' } }. Do you explicitly use a dynamic color in your app? Otherwise none of the built-in components should use a dynamic color. The RNTester does, but that shouldn't impact your code.

@ospfranco
Copy link
Author

ospfranco commented Jul 21, 2020

Yes, I do, and extensively, since it is necessary to have consistent color schemes to pass apple's app review guidelines

@tom-un
Copy link
Collaborator

tom-un commented Jul 21, 2020

Ok. We need to fix it. Upstream, for iOS, we are able to implement dynamic colors using UIColor initWithDynamicProvider. The macOS NSColor originally did not have an equivalent so we made this RCTDynamicColor. In macOS 10.15 and later there is now a NSColor colorWithName:dynamicProvider: that looks promising -- so we could use it if running on 10.15 or later and fallback to RCTDynamicColor otherwise.

@Saadnajmi
Copy link
Collaborator

I would actually like to keep this bug and open. I was not aware that there was a way to make Dynamic Colors thread safe. With RN-macOS 0.66, we are bumping the minimum to 10.15 so this might actually be a good solution.

@Saadnajmi Saadnajmi reopened this Jan 16, 2022
@Saadnajmi Saadnajmi added Area: PlatformColor bug Something isn't working labels Jan 16, 2022
@Saadnajmi Saadnajmi mentioned this issue Feb 17, 2022
4 tasks
@Saadnajmi
Copy link
Collaborator

This should be fixed with the latest RN-macOS 0.66.13 +

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: PlatformColor bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants