@sceneview-sdk/react-native 4.17.0 → 4.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,6 +3,7 @@ package io.github.sceneview.reactnative
|
|
|
3
3
|
import android.widget.FrameLayout
|
|
4
4
|
import androidx.compose.foundation.layout.fillMaxSize
|
|
5
5
|
import androidx.compose.runtime.DisposableEffect
|
|
6
|
+
import androidx.compose.runtime.key
|
|
6
7
|
import androidx.compose.runtime.mutableStateListOf
|
|
7
8
|
import androidx.compose.runtime.mutableStateOf
|
|
8
9
|
import androidx.compose.runtime.remember
|
|
@@ -110,9 +111,19 @@ class SceneViewManager : SimpleViewManager<FrameLayout>() {
|
|
|
110
111
|
}
|
|
111
112
|
|
|
112
113
|
val environment = state.environmentPath.value?.let { path ->
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
// Rebuild the Environment when `path` switches between two non-null HDRs, else the
|
|
115
|
+
// skybox/IBL freezes on the first one (#2361, same class as #2353): the factory
|
|
116
|
+
// lambda alone is a stable remember key. Uses Compose key {} rather than
|
|
117
|
+
// rememberEnvironment's own key= param because this bridge compiles against the
|
|
118
|
+
// published Maven artifact (sceneview:4.7.0) that predates key=. key {} replaces
|
|
119
|
+
// the group on a new path, disposing the old Environment via its DisposableEffect.
|
|
120
|
+
// TODO(#2361): migrate to rememberEnvironment(..., key = path) once this bridge
|
|
121
|
+
// consumes a SceneView release that includes the public key= param.
|
|
122
|
+
key(path) {
|
|
123
|
+
rememberEnvironment(environmentLoader) {
|
|
124
|
+
environmentLoader.createHDREnvironment(path)
|
|
125
|
+
?: io.github.sceneview.createEnvironment(environmentLoader)
|
|
126
|
+
}
|
|
116
127
|
}
|
|
117
128
|
}
|
|
118
129
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sceneview-sdk/react-native",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.18.0",
|
|
4
4
|
"description": "React Native bindings for SceneView — 3D and AR scenes powered by Filament (Android) and RealityKit (iOS)",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|