Xcode 14.3 Use of bitwise ‘|’ with boolean operands

Lee young-jun
2 min readMay 11, 2023

In last article, I solved an error raised by Xcode 14.3.
However I encountered another error.

I could solve this error just by tapping ‘fix’.

node->setLayoutHadOverflow(
node->getLayout().hadOverflow() ||
currentRelativeChild->getLayout().hadOverflow());
}
return deltaFreeSpace;
}

But I hate to do this always after installing package.

Patch React-Native

And I found way to fix this automatically whenever installing package again.

Install patch-package

First I had to install patch-package package.

yarn add patch-package

Create patch

Second this command after modifying react-native package.

patch-package react-native

So patch/react-native+0.65.3.patch will be created. (my project uses RN 0.65.3)

diff --git a/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.cpp b/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.cpp
index 33f70e8..1019026 100644
--- a/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.cpp
+++ b/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.cpp
@@ -2229,7 +2229,7 @@ static float YGDistributeFreeSpaceSecondPass(
depth,
generationCount);
node->setLayoutHadOverflow(
- node->getLayout().hadOverflow() |
+ node->getLayout().hadOverflow() ||
currentRelativeChild->getLayout().hadOverflow());
}
return deltaFreeSpace;

Apply Patch

To apply a created patch file to package, I should run this command.

patch-package

However I want to run automatically.

To run this command, I should add postinstall into package.json script

"scripts": {
...,
"postinstall": "patch-package"
}

My project already have postinstall script, so I modified it like this

"scripts": {
...,
"postinstall": "yarn run jetify; yarn install-ios-perm; patch-package"
}

This will run patch-package automatically after installing package.

References

--

--