Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.facebook.common.logging.FLog
import com.facebook.react.bridge.ReadableArray
import com.facebook.react.uimanager.ViewManagersPropertyCache.PropSetter
import java.util.HashMap
import java.util.concurrent.ConcurrentHashMap

@Suppress("DEPRECATION")
public object ViewManagerPropertyUpdater {
Expand All @@ -31,8 +32,11 @@ public object ViewManagerPropertyUpdater {

private const val TAG = "ViewManagerPropertyUpdater"

private val VIEW_MANAGER_SETTER_MAP: MutableMap<Class<*>, ViewManagerSetter<*, *>> = HashMap()
private val SHADOW_NODE_SETTER_MAP: MutableMap<Class<*>, ShadowNodeSetter<*>> = HashMap()
// Used from the JS thread (view configs) and the UI thread (prop updates).
private val VIEW_MANAGER_SETTER_MAP: MutableMap<Class<*>, ViewManagerSetter<*, *>> =
ConcurrentHashMap()
private val SHADOW_NODE_SETTER_MAP: MutableMap<Class<*>, ShadowNodeSetter<*>> =
ConcurrentHashMap()

@JvmStatic
public fun clear() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import com.facebook.react.uimanager.annotations.ReactProp
import com.facebook.react.uimanager.annotations.ReactPropGroup
import com.facebook.yoga.YogaValue
import java.lang.reflect.Method
import java.util.concurrent.ConcurrentHashMap

/**
* This class is responsible for holding view manager property setters and is used in a process of
Expand All @@ -29,7 +30,9 @@ import java.lang.reflect.Method
@Suppress("DEPRECATION") // ReactShadowNode is @Deprecated but still required by this cache.
internal object ViewManagersPropertyCache {

private val CLASS_PROPS_CACHE: MutableMap<Class<*>, Map<String, PropSetter>> = HashMap()
// Used from the JS thread (view configs) and the UI thread (prop updates).
private val CLASS_PROPS_CACHE: MutableMap<Class<*>, Map<String, PropSetter>> =
ConcurrentHashMap()
private val EMPTY_PROPS_MAP: MutableMap<String, PropSetter> = HashMap()

@JvmStatic
Expand Down
Loading