From 5fb22ad1834b0bb00cd7d014a8e59ecea506ccd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Valverd=C3=A9?= Date: Fri, 8 Aug 2025 00:00:34 +0200 Subject: [PATCH] Tests --- packages/example/src/lib/TextInput.tsx | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/packages/example/src/lib/TextInput.tsx b/packages/example/src/lib/TextInput.tsx index d678adc..969b96d 100644 --- a/packages/example/src/lib/TextInput.tsx +++ b/packages/example/src/lib/TextInput.tsx @@ -1,20 +1,22 @@ import { TextField } from "@radix-ui/themes" -import { Effect } from "effect" +import { Effect, Schema } from "effect" import { Component } from "effect-fc" import { useInput } from "effect-fc/hooks" -import { JSX } from "react" export namespace TextInput { - export interface Props extends useInput.Options, TextField.RootProps {} + export interface Props extends Omit, "schema">, TextField.RootProps {} } -export class TextInput extends Component.make( - Effect.fnUntraced(function* TextInput (props: TextInput.Props) { - const input = yield* useInput(props) - return <> +export const TextInput = (schema: Schema.Schema) => Component.make( + Effect.fnUntraced(function*(props: TextInput.Props) { + const input = yield* useInput({ ...props, schema }) + return ( + + + + ) }) -).pipe( - Component.withFunctionComponentSignature<(props: TextInput.Props) => JSX.Element>() -) {} -TextInput["~Error"] \ No newline at end of file +)