Before threadColorOverride was a reanimated node or null. It returned null if the message is not a text message or there is no transition.
It contained a node with a block:
- if progress is 1 then call setThreadColorBrightness
- return interpolated color based on progress value
By using useDerivedValue I achieved something similar. Now it’s a SharedValue that:
- contains null if the message is not a text message or there is no transition
- if progress is 1 then setThreadColorBrightness is called on JS thread
- contains an interpolated color if there is a transition and it’s a text message
So the behaviour is the same but now it returns SharedValue<string | null> instead of Node | null.
threadColorOverride is used by InnerTextMessage component so I needed to migrate it too but it’s very straightforward, just add useAnimatedStyle instead of useMemo and use a shared value instead of a node
Depends on D14119