I this is really simple but I'm stuck.
I have a form in a React app that creates errors, the error codes could be
'incomplete_number' || 'incomplete_expiry' || 'incomplete_cvc' || 'incomplete_zip'
There are other errors but I don't want to show the error above.
I have a useState to capture the errors so I'm trying to populate it if the error is NOT one of the above
if (error) {
// eslint-disable-next-line no-restricted-syntax
if (error.code !== 'incomplete_number' || 'incomplete_expiry' || 'incomplete_cvc' || 'incomplete_zip') {
setErrorMessage(error.message)
}
}
This code doesn't work, but for just one it does
if (error) {
// eslint-disable-next-line no-restricted-syntax
if (error.code !== 'incomplete_number') {
setErrorMessage(error.message)
}
}
How can I test for all the errors