mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-19 20:08:04 -05:00
Compare commits
1 Commits
feat/api
...
fix/start-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a4622c4943 |
@@ -210,11 +210,9 @@ export function useSubBlockValue<T = any>(
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Determine the effective value: diff value takes precedence if in diff mode
|
// Determine the effective value: diff value takes precedence if in diff mode
|
||||||
const effectiveValue = hasSnapshotValue
|
// Use nullish coalescing to fall back to initialValue when storeValue is null or undefined
|
||||||
? snapshotValue
|
// This handles the case where a block is newly added and the subblock store hasn't been populated yet
|
||||||
: storeValue !== undefined
|
const effectiveValue = hasSnapshotValue ? snapshotValue : (storeValue ?? initialValue)
|
||||||
? storeValue
|
|
||||||
: initialValue
|
|
||||||
|
|
||||||
// Initialize valueRef on first render
|
// Initialize valueRef on first render
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user