Hello everyone
I am attempting to check e.target.value
to see if it contains a specific character, and I am doing this through using Regex.
I setup the characters I am looking for in the handleClick
function, and when I do e.target.value.includes(number)
, it gives me a specific error I am not sure how to solve.
That error is TypeError: Invalid type: first can't be a Regular Expression
I am unsure what first means in this context as I believe I have laid out the Regex correctly and includes()
seems to be the standard to find characters in React. Am I doing this correctly? Maybe there is a different function I need to be using? Any advice would be greatly appreciated.
I would also like to apologize in advance if this is an easy question or solution, I am new to React and am still learning.
Link to code: https://codepen.io/Riley-Dickerson-Sprigazalea/pen/GRVgYEM