@@ -26,16 +26,13 @@ class TestService extends Effect.Service<TestService>()("TestService", {
|
|||||||
|
|
||||||
const MyTestComponent = Effect.fn(function* MyTestComponent(props?: { readonly value?: string }) {
|
const MyTestComponent = Effect.fn(function* MyTestComponent(props?: { readonly value?: string }) {
|
||||||
const [state, setState] = React.useState("value")
|
const [state, setState] = React.useState("value")
|
||||||
const effectValue = yield* Effect.succeed(`state: ${ state }`)
|
|
||||||
|
|
||||||
yield* ReactHook.useEffect(() => Effect.andThen(
|
// yield* ReactHook.useMemo(() => Effect.andThen(
|
||||||
Effect.addFinalizer(() => Console.log("MyTestComponent umounted")),
|
// Effect.addFinalizer(() => Console.log("MyTestComponent umounted")),
|
||||||
Console.log("MyTestComponent mounted"),
|
// Console.log("MyTestComponent mounted"),
|
||||||
), [])
|
// ), [])
|
||||||
|
|
||||||
return <>
|
return <>
|
||||||
<Text>{effectValue}</Text>
|
|
||||||
|
|
||||||
<Box>
|
<Box>
|
||||||
<TextField.Root
|
<TextField.Root
|
||||||
value={state}
|
value={state}
|
||||||
|
|||||||
Reference in New Issue
Block a user