Skip to content

App crashes if parser uses a regex that is used in another worklet  #574

Closed
software-mansion/react-native-reanimated
#6796
@s77rt

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 [];
      }}
    />
  );
}

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions