# Fix Xcode 14.3 Bitwise Operator Build Error in React Native

> Resolve the 'use of bitwise | with boolean operands' Yoga build error by upgrading React Native to 0.72+ or applying a patch to the Yoga.cpp file

**URL:** https://sentry.io/answers/use-of-bitwise-with-boolean-operands-xcode-14-3-fails-builds-using-react-native-yoga/

---

## The Problem

When creating the build for a React Native project in [Xcode IDE](https://developer.apple.com/xcode/) version 14.3 or above, you get the following error:

```
Use of bitwise '|' with boolean operands
```

This is an npm dependency error. It occurs in the `Yoga.cpp` file of the React Native dependency and layout engine, [Yoga](https://www.yogalayout.dev/). This error only occurs when using React Native version 0.68 or lower or when running unpatched versions of React version 0.6, 0.70, or 0.71.

## The Solution

Upgrade to React Native version 0.72+ or to one of the patch releases with an added fix for the issue:

- Version 0.71.6
- Version 0.70.8
- Version 0.69.9

If upgrading is not possible or if you need a quick fix, you can change the bitwise operator `|`  to the boolean operator `||` yourself. You can use a library such as [`patch-package`](https://www.npmjs.com/package/patch-package) to make and keep fixes to the React Native npm dependency.

Another option is to downgrade your Xcode to version 14.2.1 or lower, as older versions do not have the version checks that cause the error.

## Note

The C++ Yoga code changed the bitwise operator `|` to the boolean operator `||` to guarantee a return of `true` or `false` only.

The root cause of the error is that Xcode version 14.3 introduced some version checks, including an iOS version check. React Native uses [CocoaPods](https://cocoapods.org/) to manage library dependencies for Xcode projects. The library dependency React-Codegen supports iOS 11, which does not build with Xcode 14.3 as described in this [React Native PR](https://github.com/react/react-native/pull/36759).

---

*Source: [sentry.io/answers/use-of-bitwise-with-boolean-operands-xcode-14-3-fails-builds-using-react-native-yoga/](https://sentry.io/answers/use-of-bitwise-with-boolean-operands-xcode-14-3-fails-builds-using-react-native-yoga/)*
