diff --git a/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.cpp b/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.cpp
index 97e6407..8c4da9d 100644
--- a/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.cpp
+++ b/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.cpp
@@ -2286,7 +2286,7 @@ static float YGDistributeFreeSpaceSecondPass(
         depth,
         generationCount);
     node->setLayoutHadOverflow(
-        node->getLayout().hadOverflow() |
+        node->getLayout().hadOverflow() ||
         currentRelativeChild->getLayout().hadOverflow());
   }
   return deltaFreeSpace;
diff --git a/node_modules/react-native/react.gradle b/node_modules/react-native/react.gradle
index 847edf5..4743ae9 100644
--- a/node_modules/react-native/react.gradle
+++ b/node_modules/react-native/react.gradle
@@ -299,6 +299,7 @@ afterEvaluate {
         // mergeResources task runs before the bundle file is copied to the intermediate asset directory from Android plugin 4.1+.
         // This ensures to copy the bundle file before mergeResources task starts
         def mergeResourcesTask = tasks.findByName("merge${targetName}Resources")
+        currentAssetsCopyTask.dependsOn(currentBundleTask) // See: https://github.com/facebook/react-native/issues/31157
         mergeResourcesTask.dependsOn(currentAssetsCopyTask)
 
         packageTask.dependsOn(currentAssetsCopyTask)
diff --git a/node_modules/react-native/scripts/react_native_pods.rb b/node_modules/react-native/scripts/react_native_pods.rb
index db9a34a..2dc8d52 100644
--- a/node_modules/react-native/scripts/react_native_pods.rb
+++ b/node_modules/react-native/scripts/react_native_pods.rb
@@ -165,7 +165,9 @@ def use_react_native_codegen!(spec, options={})
   return if ENV['DISABLE_CODEGEN'] == '1'
 
   # The path to react-native (e.g. react_native_path)
-  prefix = options[:path] ||= File.join(__dir__, "..")
+  # Patched using: https://github.com/facebook/react-native/issues/31193#issuecomment-802662254
+  # Necessary until this issue is fixed: https://github.com/facebook/react-native/issues/31121
+  prefix = options[:path] ||= "../../node_modules/react-native"
 
   # The path to JavaScript files
   srcs_dir = options[:srcs_dir] ||= File.join(prefix, "Libraries")
@@ -208,12 +210,12 @@ def use_react_native_codegen!(spec, options={})
     :name => 'Generate Specs',
     :input_files => [srcs_dir],
     :output_files => ["$(DERIVED_FILE_DIR)/codegen-#{codegen_modules_library_name}.log"].concat(generated_files),
-    :script => "set -o pipefail\n\nbash -l -c '#{env_vars} CODEGEN_MODULES_LIBRARY_NAME=#{codegen_modules_library_name} #{File.join(__dir__, "generate-specs.sh")}' 2>&1 | tee \"${SCRIPT_OUTPUT_FILE_0}\"",
+    :script => "set -o pipefail\nexport NODE_BINARY=\"$(zsh -ilc 'asdf which node' 2> /dev/null || echo '')\"\nbash -l -c '#{env_vars} CODEGEN_MODULES_LIBRARY_NAME=#{codegen_modules_library_name} ../../node_modules/react-native/scripts/generate-specs.sh' 2>&1 | tee \"${SCRIPT_OUTPUT_FILE_0}\"",
     :execution_position => :before_compile,
     :show_env_vars_in_log => true
   }
 
-  spec.prepare_command = "#{mkdir_command} && touch #{generated_files.reduce() { |str, file| str + " " + file }}"
+  spec.prepare_command = "cd ../.. && #{mkdir_command} && touch #{generated_files.reduce() { |str, file| str + " " + file }}"
 end
 
 # Local method for the Xcode 12.5 fix
