ReanimatedのWorklet
from
react-native-reanimated
Native/Main Thread
で実行可能な短時間のJS関数のこと
JS関数をコピーしてNative Threadで実行できるserializable objectに変換される
defaultでNative Threadで実行されるが、
JavaScript Thread
で実行することもできる
docs
'worklet'
directive
code:ts
function myWorklet() {
'worklet';
console.log('Running on the UI thread');
}
これv2でなくなったのかな?普通にdocsには書いてるけど
Reanimated Babel plugin
自動worklet化をする
https://github.com/software-mansion/react-native-reanimated/blob/main/plugin/README-dev.md