Skip to content
Discussion options

You must be logged in to vote

Hey @thisisgit!
You can use Set and Map only a single runtime at a time and transfer it between runtimes. That is why you can assign Set to a SharedValue on the UI runtime (within the runOnUI callback) and use all its methods. The same happens if you are using Set or Map only on JS.

The problem starts to happen when you want to access Set/Map from the JS runtime when the object lives on the UI runtime (was created within a worklet executed on the UI thread) or access the object created in the JS runtime from the UI thread.

Does this mean that Map and Set are only supported within worklets, e.g. using them as variables in worklets, but not in shared value?

You are right, they are support…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by thisisgit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants