Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple hashtags #94

Open
andrefangeloni opened this issue Jan 27, 2021 · 1 comment
Open

Multiple hashtags #94

andrefangeloni opened this issue Jan 27, 2021 · 1 comment

Comments

@andrefangeloni
Copy link

andrefangeloni commented Jan 27, 2021

Hi there,
When the text has multiple hashtag, how could I know witch of them was pressed?
e.g:
Nice job!
#foo #bar

I'd like to do a feature likes Instagram, search for specific hashtag, but onPress is generic.
Thanks

@ameer-taghavi
Copy link

pattern:

{
  pattern: /#[^\s!@#$%^&*()=+./,\[{\]};:'"?><،؛؟-]+/gi,
  style: [_linkStyle, linkStyle, boldFont],
  onPress: handleHashtagPress,
}

on press hashtag:

const handleHashtagPress = (value, matchIndex) => {
  navigation.push('Posts', {
    hashtag: {text: value.slice(1)}, // value.slice(1): value without # sign
  });
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants