Created
January 19, 2021 16:58
-
-
Save AllanGraves/5e78d5ea0153ddfb13c6f9959cbc3513 to your computer and use it in GitHub Desktop.
regexifyString example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const result = regexifyString({ | |
pattern: /{var .*}/gim, | |
decorator: (match, index) => { | |
console.log(match); | |
let textToDisplay = match.slice(4, -1); | |
return <VarInput inputText={textToDisplay} key={index} />; | |
}, | |
input: text, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment