From c881416ff05f2f7ceb8d5232ce9d5b12db5dd300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Valverd=C3=A9?= Date: Sat, 9 Aug 2025 02:07:55 +0200 Subject: [PATCH] TextInput work --- packages/example/src/lib/TextInput.tsx | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/packages/example/src/lib/TextInput.tsx b/packages/example/src/lib/TextInput.tsx index 20a8497..2e12ba0 100644 --- a/packages/example/src/lib/TextInput.tsx +++ b/packages/example/src/lib/TextInput.tsx @@ -1,20 +1,26 @@ import { TextField } from "@radix-ui/themes" -import { Schema } from "effect" +import { Duration, Equivalence, Record, Schema } from "effect" import { Component } from "effect-fc" import { useInput } from "effect-fc/hooks" -export namespace TextInput { - export interface Props extends Omit, "schema">, TextField.RootProps {} +export interface TextInputProps extends Omit, "schema"> { + readonly textFieldRootProps: TextField.RootProps } +export const TextInputPropsEquivalence: Equivalence.Equivalence> = Equivalence.struct({ + ref: Equivalence.strict(), + debounce: Duration.Equivalence, + textFieldRootProps: Record.getEquivalence(Equivalence.strict()), +}) + + export const TextInput = (schema: Schema.Schema) => Component.makeUntraced( - function* TextInput(props: TextInput.Props) { + function* TextInput(props: TextInputProps) { const input = yield* useInput({ ...props, schema }) + return ( - + )