From df6e50f5e620c5cdc7ade003930663c2f314c4cf Mon Sep 17 00:00:00 2001 From: Igor Furgala Date: Fri, 17 Oct 2025 22:01:07 +0200 Subject: [PATCH] fix: android - RN_SERIALIZABLE_STATE --- android/src/main/new_arch/CMakeLists.txt | 22 +++++++++++++--------- example/src/App.tsx | 13 +++++++++++++ 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/android/src/main/new_arch/CMakeLists.txt b/android/src/main/new_arch/CMakeLists.txt index be99d0f..ab00a41 100644 --- a/android/src/main/new_arch/CMakeLists.txt +++ b/android/src/main/new_arch/CMakeLists.txt @@ -39,15 +39,19 @@ target_link_libraries( ReactAndroid::reactnative ) -target_compile_options( - ${LIB_TARGET_NAME} - PRIVATE - -DLOG_TAG=\"ReactNative\" - -fexceptions - -frtti - -Wall - -std=c++20 -) +if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 80) + target_compile_reactnative_options(${LIB_TARGET_NAME} PRIVATE) +else() + target_compile_options( + ${LIB_TARGET_NAME} + PRIVATE + -DLOG_TAG=\"ReactNative\" + -fexceptions + -frtti + -Wall + -std=c++20 + ) +endif() target_include_directories( ${CMAKE_PROJECT_NAME} diff --git a/example/src/App.tsx b/example/src/App.tsx index 7d93a28..c36dd62 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -80,6 +80,10 @@ export default function App() { const [currentLink, setCurrentLink] = useState(DEFAULT_LINK_STATE); + const [key, setKey] = useState(0); + const incrementKey = () => setKey((v) => v + 1); + const collectGarbage = () => global.gc?.(); + const ref = useRef(null); const userMention = useUserMention(); @@ -259,6 +263,7 @@ export default function App() { Enriched Text Input