Skip to content

Commit 9f00e71

Browse files
onmotionTheHypnoo
andauthored
React 19 support (#170)
* Working with React 19 (#168) * fix: update MutableRefObject import to use React namespace * fix: update dependencies in useEffect hooks for better stability and clean up props spreading * fix: update devDependencies and dependencies for compatibility with latest versions * fix: update dependencies and scripts for compatibility with latest versions * fix: update Android build configuration for compatibility and enable new architecture * fix: update dependencies in yarn * fix: update type definitions * chore: rebase (#169) * fix: typo * fix: keyboardAvoidingView bahavior --------- Co-authored-by: Sergi Gonzalez <31130069+TheHypnoo@users.noreply.github.com>
1 parent 9c3f7f2 commit 9f00e71

File tree

44 files changed

+4543
-4972
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+4543
-4972
lines changed

example/.bundle/config

Lines changed: 0 additions & 2 deletions
This file was deleted.

example/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const App = () => {
3838
<StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} />
3939
<KeyboardAvoidingView
4040
style={styles.scrollContainer}
41-
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
41+
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
4242
enabled>
4343
<ScrollView
4444
nestedScrollEnabled

example/Gemfile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1-
source 'https://rubygems.org'
1+
source "https://rubygems.org"
22

33
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
44
ruby ">= 2.6.10"
55

66
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
7-
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
8-
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
7+
gem "cocoapods", ">= 1.13", "!= 1.15.0", "!= 1.15.1"
8+
gem "activesupport", ">= 6.1.7.5", "!= 7.1.0"
9+
gem "xcodeproj", "< 1.26.0"
10+
gem "concurrent-ruby", "< 1.3.4"
11+
12+
# Ruby 3.4.0 has removed some libraries from the standard library.
13+
gem "bigdecimal"
14+
gem "logger"
15+
gem "benchmark"
16+
gem "mutex_m"

example/__tests__/App.test.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,12 @@
22
* @format
33
*/
44

5-
import 'react-native'
65
import React from 'react'
7-
8-
// Note: import explicitly to use the types shiped with jest.
9-
import { it } from '@jest/globals'
10-
11-
// Note: test renderer must be required after react-native.
12-
import renderer from 'react-test-renderer'
6+
import ReactTestRenderer from 'react-test-renderer'
137
import App from '../App'
148

15-
it('renders correctly', () => {
16-
renderer.create(<App />)
9+
test('renders correctly', async () => {
10+
await ReactTestRenderer.act(() => {
11+
ReactTestRenderer.create(<App />)
12+
})
1713
})

example/android/app/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,23 +63,23 @@ def enableProguardInReleaseBuilds = false
6363
* The preferred build flavor of JavaScriptCore (JSC)
6464
*
6565
* For example, to use the international variant, you can use:
66-
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
66+
* `def jscFlavor = io.github.react-native-community:jsc-android-intl:2026004.+`
6767
*
6868
* The international variant includes ICU i18n library and necessary data
6969
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
7070
* give correct results when using with locales other than en-US. Note that
7171
* this variant is about 6MiB larger per architecture than default.
7272
*/
73-
def jscFlavor = 'org.webkit:android-jsc:+'
73+
def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+'
7474

7575
android {
7676
ndkVersion rootProject.ext.ndkVersion
7777
buildToolsVersion rootProject.ext.buildToolsVersion
7878
compileSdk rootProject.ext.compileSdkVersion
7979

80-
namespace "com.autocomletedropdownplayground"
80+
namespace "com.autocompletedropdownplayground"
8181
defaultConfig {
82-
applicationId "com.autocomletedropdownplayground"
82+
applicationId "com.autocompletedropdownplayground"
8383
minSdkVersion rootProject.ext.minSdkVersion
8484
targetSdkVersion rootProject.ext.targetSdkVersion
8585
versionCode 1

example/android/app/src/main/java/com/autocomletedropdownplayground/MainActivity.kt renamed to example/android/app/src/main/java/com/autocompletedropdownplayground/MainActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.autocomletedropdownplayground
1+
package com.autocompletedropdownplayground
22

33
import com.facebook.react.ReactActivity
44
import com.facebook.react.ReactActivityDelegate
@@ -11,7 +11,7 @@ class MainActivity : ReactActivity() {
1111
* Returns the name of the main component registered from JavaScript. This is used to schedule
1212
* rendering of the component.
1313
*/
14-
override fun getMainComponentName(): String = "AutocomleteDropdownPlayground"
14+
override fun getMainComponentName(): String = "AutocompleteDropdownPlayground"
1515

1616
/**
1717
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]

example/android/app/src/main/java/com/autocomletedropdownplayground/MainApplication.kt renamed to example/android/app/src/main/java/com/autocompletedropdownplayground/MainApplication.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.autocomletedropdownplayground
1+
package com.autocompletedropdownplayground
22

33
import android.app.Application
44
import com.facebook.react.PackageList
@@ -9,6 +9,7 @@ import com.facebook.react.ReactPackage
99
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
1010
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
1111
import com.facebook.react.defaults.DefaultReactNativeHost
12+
import com.facebook.react.soloader.OpenSourceMergedSoMapping
1213
import com.facebook.soloader.SoLoader
1314

1415
class MainApplication : Application(), ReactApplication {
@@ -34,7 +35,7 @@ class MainApplication : Application(), ReactApplication {
3435

3536
override fun onCreate() {
3637
super.onCreate()
37-
SoLoader.init(this, false)
38+
SoLoader.init(this, OpenSourceMergedSoMapping)
3839
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
3940
// If you opted-in for the New Architecture, we load the native entry point for this app.
4041
load()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<resources>
2-
<string name="app_name">AutocomleteDropdownPlayground</string>
2+
<string name="app_name">AutocompleteDropdownPlayground</string>
33
</resources>

example/android/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
buildscript {
22
ext {
3-
buildToolsVersion = "34.0.0"
4-
minSdkVersion = 23
5-
compileSdkVersion = 34
6-
targetSdkVersion = 34
7-
ndkVersion = "26.1.10909125"
8-
kotlinVersion = "1.9.24"
3+
buildToolsVersion = "35.0.0"
4+
minSdkVersion = 24
5+
compileSdkVersion = 35
6+
targetSdkVersion = 35
7+
ndkVersion = "27.1.12297006"
8+
kotlinVersion = "2.0.21"
99
}
1010
repositories {
1111
google()

example/android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
3232
# your application. You should enable this flag either if you want
3333
# to write custom TurboModules/Fabric components OR use libraries that
3434
# are providing them.
35-
newArchEnabled=false
35+
newArchEnabled=true
3636

3737
# Use this property to enable or disable the Hermes JS engine.
3838
# If set to false, you will be using JSC instead.

0 commit comments

Comments
 (0)