Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
[![npm downloads](https://img.shields.io/npm/dm/@callstack/react-native-sandbox.svg?style=for-the-badge)](https://www.npmjs.org/package/@callstack/react-native-sandbox)
[![check](https://img.shields.io/github/actions/workflow/status/callstackincubator/react-native-sandbox/check.yml?style=for-the-badge)](https://github.com/callstackincubator/react-native-sandbox/actions/workflows/check.yml)
[![platform: iOS](https://img.shields.io/badge/platform-iOS-blue.svg?style=for-the-badge)](https://img.shields.io/badge/platform-iOS-blue.svg)
[![react-native >= 0.78](https://img.shields.io/badge/react--native-%3E%3D%200.78-61dafb.svg?style=for-the-badge&logo=react)](https://reactnative.dev/)


</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import android.app.Application
import com.facebook.react.PackageList
import com.facebook.react.ReactApplication
import com.facebook.react.ReactHost
import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative
import com.facebook.react.ReactNativeHost
import com.facebook.react.ReactPackage
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.soloader.OpenSourceMergedSoMapping
import com.facebook.soloader.SoLoader

class MainApplication : Application(), ReactApplication {

Expand All @@ -33,6 +35,9 @@ class MainApplication : Application(), ReactApplication {

override fun onCreate() {
super.onCreate()
loadReactNative(this)
SoLoader.init(this, OpenSourceMergedSoMapping)
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
load()
}
}
}
2 changes: 1 addition & 1 deletion apps/demo/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
compileSdkVersion = 35
targetSdkVersion = 35
ndkVersion = "27.1.12297006"
kotlinVersion = "2.1.20"
kotlinVersion = "2.0.21"
}
repositories {
google()
Expand Down
2 changes: 1 addition & 1 deletion apps/demo/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
33 changes: 6 additions & 27 deletions apps/demo/ios/Demo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,15 @@ import React_RCTAppDelegate
import ReactAppDependencyProvider

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
class AppDelegate: RCTAppDelegate {
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
self.moduleName = "Demo"
self.dependencyProvider = RCTAppDependencyProvider()
self.initialProps = [:]

var reactNativeDelegate: ReactNativeDelegate?
var reactNativeFactory: RCTReactNativeFactory?

func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
) -> Bool {
let delegate = ReactNativeDelegate()
let factory = RCTReactNativeFactory(delegate: delegate)
delegate.dependencyProvider = RCTAppDependencyProvider()

reactNativeDelegate = delegate
reactNativeFactory = factory

window = UIWindow(frame: UIScreen.main.bounds)

factory.startReactNative(
withModuleName: "Demo",
in: window,
launchOptions: launchOptions
)

return true
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}

class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate {
override func sourceURL(for bridge: RCTBridge) -> URL? {
self.bundleURL()
}
Expand Down
4 changes: 2 additions & 2 deletions apps/demo/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2019,7 +2019,7 @@ PODS:
- React-timing
- React-utils
- SocketRocket
- React-Sandbox (0.4.0):
- React-Sandbox (0.4.1):
- boost
- DoubleConversion
- fast_float
Expand Down Expand Up @@ -2451,7 +2451,7 @@ SPEC CHECKSUMS:
React-runtimeexecutor: 17c70842d5e611130cb66f91e247bc4a609c3508
React-RuntimeHermes: 3c88e6e1ea7ea0899dcffc77c10d61ea46688cfd
React-runtimescheduler: 024500621c7c93d65371498abb4ee26d34f5d47d
React-Sandbox: e3cf3c955559ed9f0bf014b29dce1e94600cd790
React-Sandbox: 9c091813e335735668c62b2d3dbeb1456f93d8a5
React-timing: c3c923df2b86194e1682e01167717481232f1dc7
React-utils: 9154a037543147e1c24098f1a48fc8472602c092
ReactAppDependencyProvider: afd905e84ee36e1678016ae04d7370c75ed539be
Expand Down
6 changes: 3 additions & 3 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions packages/react-native-sandbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@

This is the **developer documentation** for installing and using `@callstack/react-native-sandbox` in your React Native application.

## Requirements

- **React Native >= 0.78**
- **New Architecture** (Fabric) enabled

This library uses `RCTReactNativeFactory`, C++ TurboModules, and Fabric component APIs that are only available starting from React Native 0.78. It does not include an Old Architecture / Bridge fallback.

## 📦 Installation

### npm/yarn
Expand Down
4 changes: 2 additions & 2 deletions packages/react-native-sandbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
]
},
"peerDependencies": {
"react": "*",
"react-native": "*"
"react": ">=19.0.0",
"react-native": ">=0.78.0"
},
"devDependencies": {
"react": "19.1.0",
Expand Down
Loading