I resolved it by putting 2 Vertical bars || instead of one | in the code where it is failing.
Then cleared the build and it is working fine now on XCode 14.3. I Hope this helps someone.
Edit:
Above one is temporary solution.
By using following solution we do not need to make change on every npm installation. It is suggested by @Carl G. @Mykola Odnosumov ‘s Solution in this thread is also helpful, it is similar solution.
Thank you @Carl G and @Mykola Odnosumov
https://github.com/facebook/react-native/issues/36758#issuecomment-1496210081
- install patch-package https://github.com/ds300/patch-package
- Modify the source code like this commit 52d8a79
- run npx patch-package react-native
- commit your changes. Done.