From 42a1dd1cafc4b452907a2c6317b12b5a9c3d2ef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Valverd=C3=A9?= Date: Sun, 10 Aug 2025 18:10:02 +0200 Subject: [PATCH] TextFieldInput --- .../src/lib/{TextInput.tsx => TextFieldInput.tsx} | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) rename packages/example/src/lib/{TextInput.tsx => TextFieldInput.tsx} (78%) diff --git a/packages/example/src/lib/TextInput.tsx b/packages/example/src/lib/TextFieldInput.tsx similarity index 78% rename from packages/example/src/lib/TextInput.tsx rename to packages/example/src/lib/TextFieldInput.tsx index e2b7514..ee31939 100644 --- a/packages/example/src/lib/TextInput.tsx +++ b/packages/example/src/lib/TextFieldInput.tsx @@ -5,20 +5,20 @@ import { useInput } from "effect-fc/hooks" import * as React from "react" -export interface TextInputProps extends Omit, "schema"> { +export interface TextFieldInputProps extends Omit, "schema"> { readonly textFieldRootProps: Omit readonly children?: React.ReactNode } -export const TextInput = ( +export const TextFieldInput = ( schema: Schema.Schema ): Component.Component< - TextInputProps, + TextFieldInputProps, React.JSX.Element, ParseResult.ParseError, R -> => Component.makeUntraced(function* TextInput(props: TextInputProps) { - const input = yield* useInput({ ...props, schema }) +> => Component.makeUntraced(function* TextFieldInput(props) { + const input = yield* useInput({ schema, ...props }) const issues = React.useMemo(() => Option.map( input.error, ParseResult.ArrayFormatter.formatErrorSync, @@ -27,7 +27,7 @@ export const TextInput = ( return ( {Option.isSome(issues) && - +
    {issues.value.map(issue =>
  • {issue.message}
  • )}