Unify Derivation and Prism 11/n
`useDerivation()` => `usePrismInstance()`
This commit is contained in:
parent
1236900ddf
commit
b2116e9a5d
10 changed files with 51 additions and 51 deletions
|
@ -7,7 +7,7 @@ import getStudio from '@theatre/studio/getStudio'
|
|||
import type Scrub from '@theatre/studio/Scrub'
|
||||
import type {IContextMenuItem} from '@theatre/studio/uiComponents/simpleContextMenu/useContextMenu'
|
||||
import getDeep from '@theatre/shared/utils/getDeep'
|
||||
import {useDerivation} from '@theatre/react'
|
||||
import {usePrismInstance} from '@theatre/react'
|
||||
import type {
|
||||
$IntentionalAny,
|
||||
SerializablePrimitive as SerializablePrimitive,
|
||||
|
@ -355,7 +355,7 @@ export function useEditingToolsForSimplePropInDetailsPanel<
|
|||
propConfig: PropTypeConfig_AllSimples,
|
||||
): EditingTools<T> {
|
||||
const der = getDerivation(pointerToProp, obj, propConfig)
|
||||
return useDerivation(der)
|
||||
return usePrismInstance(der)
|
||||
}
|
||||
|
||||
type Shade =
|
||||
|
|
|
@ -5,7 +5,7 @@ import {useEffect} from 'react'
|
|||
import {useLogger} from './useLogger'
|
||||
import {Box, prism, pointerToPrism} from '@theatre/dataverse'
|
||||
import {Atom} from '@theatre/dataverse'
|
||||
import {useDerivation} from '@theatre/react'
|
||||
import {usePrismInstance} from '@theatre/react'
|
||||
import {selectClosestHTMLAncestor} from '@theatre/studio/utils/selectClosestHTMLAncestor'
|
||||
|
||||
/** To mean the presence value */
|
||||
|
@ -95,7 +95,7 @@ function createPresenceContext(options: {
|
|||
}
|
||||
})
|
||||
}, [itemKey])
|
||||
return useDerivation(focusD)
|
||||
return usePrismInstance(focusD)
|
||||
},
|
||||
setUserHover(itemKeyOpt) {
|
||||
const prev = currentUserHoverItemB.get()
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {isPrism, prism, val} from '@theatre/dataverse'
|
||||
import type {Prism, Pointer} from '@theatre/dataverse'
|
||||
import {useDerivation} from '@theatre/react'
|
||||
import {usePrismInstance} from '@theatre/react'
|
||||
import type {$IntentionalAny} from '@theatre/shared/utils/types'
|
||||
import React, {useMemo, useRef} from 'react'
|
||||
import {invariant} from './invariant'
|
||||
|
@ -86,7 +86,7 @@ export function deriver<Props extends {}>(
|
|||
)
|
||||
|
||||
const allD = useMemo(() => deriveAllD(observables), observableArr)
|
||||
const observedPropState = useDerivation(allD)
|
||||
const observedPropState = usePrismInstance(allD)
|
||||
|
||||
return (
|
||||
observedPropState &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue