Skip to content

fix: version-gate generated RawProps::at() for react-native 0.87#1424

Open
cortinico wants to merge 1 commit into
mrousavy:mainfrom
cortinico:nc/rawprops
Open

fix: version-gate generated RawProps::at() for react-native 0.87#1424
cortinico wants to merge 1 commit into
mrousavy:mainfrom
cortinico:nc/rawprops

Conversation

@cortinico

@cortinico cortinico commented Jun 26, 2026

Copy link
Copy Markdown

react-native 0.87 removed the (name, prefix, suffix) overload of
react::RawProps::at() in favor of a single-argument at(name):

This breaks nitro codegen output on newer react-native while older versions
(<= 0.86) still require the 3-argument form.

Update the CppHybridViewComponent codegen template to emit a
NITRO_RAWPROPS_AT macro guarded by REACT_NATIVE_VERSION_* (from
<cxxreact/ReactNativeVersion.h>):

  • RN > 0.86 (incl. nightly 1000.x): rawProps.at(name)
  • RN <= 0.86: rawProps.at(name, nullptr, nullptr)

Regenerate the committed HybridTestView / HybridRecyclableTestView
component files so the generated output stays in sync with the template.

react-native 0.87 removed the (name, prefix, suffix) overload of
react::RawProps::at() in favor of a single-argument at(name) (D94367880),
breaking codegen output on newer react-native while older versions
(<= 0.86) still require the 3-argument form.

Update the CppHybridViewComponent codegen template to emit a
NITRO_RAWPROPS_AT macro guarded by REACT_NATIVE_VERSION_* (from
<cxxreact/ReactNativeVersion.h>):

  * RN > 0.86 (incl. nightly 1000.x): rawProps.at(name)
  * RN <= 0.86:                       rawProps.at(name, nullptr, nullptr)

Regenerate the committed HybridTestView / HybridRecyclableTestView
component files so the generated output stays in sync with the template.
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
nitro-docs Skipped Skipped Jun 26, 2026 12:38pm

Request Review

@cortinico
cortinico marked this pull request as ready for review June 26, 2026 12:39
@mrousavy

Copy link
Copy Markdown
Owner

Hey Nico thanks for this PR! Really appreciate it ❤️
While it seems to fix the compat, I'm not sure if I like C/C++ macros (#define + #undef) in this case.

There is no super elegant fix for this, but I just created #1425 which ships this in a .cpp file, allowing us to potentially change params if this API surface is expected to change again in the future.

Btw., this begs the question - why don't we keep a RawProps::at(char*, char*, char*) overload in RN core?

@cortinico

Copy link
Copy Markdown
Author

Btw., this begs the question - why don't we keep a RawProps::at(char*, char*, char*) overload in RN core?

Yeah we're re-adding it but we intend to remove it in a future version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants