App crashes if parser uses a regex that is used in another worklet #574
Description
Using same regex (or objects that contain regex) in multiple worklets causes a crash. This is possibly a bug in react-native-reanimated but I'm not sure. cc @tomekzaw You may have an idea on this
Reproducible example:
function Markdown() {
const regex = /\d/;
useAnimatedStyle(() => {
console.log(regex);
return {};
}, []);
return (
<MarkdownTextInput
parser={() => {
'worklet';
console.log(regex);
return [];
}}
/>
);
}