@@ -115,7 +115,7 @@ export const make = <Args extends readonly any[], A extends React.ReactNode, E,
|
|||||||
)
|
)
|
||||||
|
|
||||||
export const withFunctionComponentSignature: {
|
export const withFunctionComponentSignature: {
|
||||||
<F extends FunctionComponent>(): <T extends Component<F, any, any>>(self: T) =>
|
<F extends FunctionComponent>(): <T extends Component<any, any, any>>(self: T) =>
|
||||||
& Omit<T, keyof Component.AsComponent<T>>
|
& Omit<T, keyof Component.AsComponent<T>>
|
||||||
& Component<F, Component.Error<T>, Component.Context<T>>
|
& Component<F, Component.Error<T>, Component.Context<T>>
|
||||||
} = () => identity
|
} = () => identity
|
||||||
|
|||||||
@@ -1,12 +1,16 @@
|
|||||||
import { TextField } from "@radix-ui/themes"
|
import { TextField } from "@radix-ui/themes"
|
||||||
|
import { Effect } from "effect"
|
||||||
import { Component } from "effect-fc"
|
import { Component } from "effect-fc"
|
||||||
import { Hooks } from "effect-fc/hooks"
|
import { Hooks } from "effect-fc/hooks"
|
||||||
|
import { JSX } from "react"
|
||||||
|
|
||||||
|
|
||||||
export namespace TextInput {
|
export namespace TextInput {
|
||||||
export interface Props<A, R> extends Hooks.useInput.Options<A, R>, TextField.RootProps {}
|
export interface Props<A, R> extends Hooks.useInput.Options<A, R>, TextField.RootProps {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class TextInput extends Component.make(function* TextInput(props: TextInput.Props<A, R>) {
|
export class TextInput extends Component.make(Effect.fnUntraced(function* TextInput <A, R>(props: TextInput.Props<A, R>) {
|
||||||
return <></>
|
return <></>
|
||||||
}) {}
|
})).pipe(
|
||||||
|
Component.withFunctionComponentSignature<<A, R>(props: TextInput.Props<A, R>) => JSX.Element>()
|
||||||
|
) {}
|
||||||
|
|||||||
Reference in New Issue
Block a user