Skip to content

Conversation

Sosotess93
Copy link

What

Add guarded C++ includes (<string>, <memory>) required by std::string and smart pointers used in RNDatePicker.mm.

Why

On newer React Native versions (tested on RN 0.81.1 with Xcode 15 / Apple Silicon), the iOS build fails with:
No type named 'string' in namespace 'std' because the file uses C++ types without including the proper headers.

This issue was not visible on older RN versions (e.g. 0.73.x) but breaks compilation starting with RN 0.81.x due to stricter C++ toolchains.

How

Minimal change: add the missing includes at the top of RNDatePicker.mm, guarded by #ifdef __cplusplus to ensure safety even if the file is compiled as Objective-C.

#ifdef __cplusplus
#include <string>
#include <memory>
#endif

Testing

  • Built iOS example app (0.73) locally on macOS + Apple Silicon and test fix on 0.81.1.
  • Picker renders and updates without errors.

Breaking changes

None

@EmilJunker
Copy link

I am getting this error on the old architecture. But your fix seems to only add the import on the new architecture. This won't fix the issue described in #937.

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