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

parse the state #76

Closed
copper123 opened this issue Mar 18, 2020 · 5 comments
Closed

parse the state #76

copper123 opened this issue Mar 18, 2020 · 5 comments
Labels

Comments

@copper123
Copy link

How can I parse the variable from this.state.xx? the code below give no help

<ParsedText
style={styles.text}
parse={
[
{pattern: /{this.state.search}/,style: styles.found},
]
}
childrenProps={{allowFontScaling: false}}

blahblah

@dhruvdgupta
Copy link

try

pattern: /${this.state.search}/

@copper123
Copy link
Author

thanks dhruvdewangupta, but it does not work

@JongGyuChoi
Copy link

i found the solution
try
pattern : RegExp(variable)

@fbartho
Copy link
Contributor

fbartho commented Jun 11, 2020

Closing the issue since there's a suggested solution. Please let me know if that doesn't work @copper123

If you find a bug or have a PR, I'm working on a new release in #79

@fbartho fbartho closed this as completed Jun 11, 2020
@copper123
Copy link
Author

Sorry for the late.
Still does not work
@JongGyuChoi do you mean
pattern : RegExp(/{this.state.search}/)

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

No branches or pull requests

4 participants