More progress on shorthand types

This commit is contained in:
Aria Minaei 2021-09-06 11:26:00 +02:00
parent aefb769855
commit f6cf3711f4
14 changed files with 109 additions and 103 deletions

View file

@ -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

View file

@ -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()