From 00bb2d33104384025b1f158a29d18a1c27911de3 Mon Sep 17 00:00:00 2001 From: Aria Minaei Date: Tue, 24 Jan 2023 18:45:41 +0100 Subject: [PATCH] Fix the recursion issue with theatric --- .../playground/src/shared/theatric/index.tsx | 10 +++--- packages/theatric/src/index.ts | 32 ++++++++++++++++--- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/packages/playground/src/shared/theatric/index.tsx b/packages/playground/src/shared/theatric/index.tsx index d9d33ce..ce0cc13 100644 --- a/packages/playground/src/shared/theatric/index.tsx +++ b/packages/playground/src/shared/theatric/index.tsx @@ -1,4 +1,4 @@ -import {button, initialize, useControls} from 'theatric' +import {button, initialize, types, useControls} from 'theatric' import {render} from 'react-dom' import React, {useState} from 'react' import state from './state.json' @@ -32,11 +32,12 @@ function App() { baz: button(() => console.log($get((p) => p.bar))), }) - const {another, panel, yo} = useControls( + const {another, panel, col, yo} = useControls( { another: '', panel: '', - yo: 0, + yo: types.number(0), + col: types.rgba(), }, {panel: 'My panel'}, ) @@ -54,7 +55,7 @@ function App() { justifyContent: 'center', }} > -
{JSON.stringify(bar)}
+ {/*
{JSON.stringify(bar)}
*/}