More progress on shorthand types
This commit is contained in:
parent
aefb769855
commit
f6cf3711f4
14 changed files with 109 additions and 103 deletions
|
@ -2,16 +2,15 @@ import type {IScrub, IStudio} from '@theatre/studio'
|
|||
import studio from '@theatre/studio'
|
||||
import React, {useLayoutEffect, useMemo, useState} from 'react'
|
||||
import type {ISheet, ISheetObject, IProject} from '@theatre/core'
|
||||
import {types as t} from '@theatre/core'
|
||||
import type {UseDragOpts} from './useDrag'
|
||||
import useDrag from './useDrag'
|
||||
|
||||
studio.initialize()
|
||||
|
||||
const boxObjectConfig = t.compound({
|
||||
x: t.number(0),
|
||||
y: t.number(0),
|
||||
})
|
||||
const boxObjectConfig = {
|
||||
x: 0,
|
||||
y: 0,
|
||||
}
|
||||
|
||||
const Box: React.FC<{
|
||||
id: string
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
import studio from '@theatre/studio'
|
||||
import {useLayoutEffect, useMemo, useState} from 'react'
|
||||
import {types as t} from '@theatre/core'
|
||||
import useDrag from './useDrag'
|
||||
|
||||
studio.initialize()
|
||||
|
||||
const boxObjectConfig = t.compound({
|
||||
x: t.number(0),
|
||||
y: t.number(0),
|
||||
})
|
||||
const boxObjectConfig = {
|
||||
x: 0,
|
||||
y: 0,
|
||||
}
|
||||
|
||||
const Box = ({id, sheet, selectedObject}) => {
|
||||
// This is cheap to call and always returns the same value, so no need for useMemo()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue