From d0e5cb1ced883b4fc2155e196574068fee8bf1ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Valverd=C3=A9?= Date: Sun, 10 Aug 2025 01:35:24 +0200 Subject: [PATCH] Fix --- packages/example/src/lib/TextInput.tsx | 44 ++++++++++++++------------ 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/packages/example/src/lib/TextInput.tsx b/packages/example/src/lib/TextInput.tsx index 6615a56..609a9c3 100644 --- a/packages/example/src/lib/TextInput.tsx +++ b/packages/example/src/lib/TextInput.tsx @@ -1,30 +1,32 @@ import { TextField } from "@radix-ui/themes" -import { Duration, Equivalence, Record, Schema } from "effect" +import { type ParseResult, Schema } from "effect" import { Component } from "effect-fc" import { useInput } from "effect-fc/hooks" +import type * as React from "react" export interface TextInputProps extends Omit, "schema"> { - readonly textFieldRootProps: TextField.RootProps + readonly textFieldRootProps: Omit + readonly children?: React.ReactNode } -export const TextInputPropsEquivalence: Equivalence.Equivalence> = Equivalence.struct({ - ref: Equivalence.strict(), - debounce: (self?: Duration.Duration, that?: Duration.Duration) => (self === undefined || that === undefined) - ? self === that - : Duration.Equivalence(self, that), - textFieldRootProps: Record.getEquivalence(Equivalence.strict()), +export const TextInput = ( + schema: Schema.Schema +): Component.Component< + TextInputProps, + React.JSX.Element, + ParseResult.ParseError, + R +> => Component.makeUntraced(function* TextInput(props: TextInputProps) { + const input = yield* useInput({ ...props, schema }) + + return ( + + {props.children} + + ) }) - - -export const TextInput = (schema: Schema.Schema) => Component.makeUntraced( - function* TextInput(props: TextInputProps) { - const input = yield* useInput({ ...props, schema }) - - return ( - - - - ) - } -)