Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

fix(example-nextjs): make TextInput controlled to fix typecheck (#3060)

nynexman4464abf30ffb16d1
diff --git a/apps/example-nextjs/src/app/page.tsx b/apps/example-nextjs/src/app/page.tsx
index c76a5d3741..a892ae1ef2 100644
--- a/apps/example-nextjs/src/app/page.tsx
+++ b/apps/example-nextjs/src/app/page.tsx
@@ -2,6 +2,7 @@
'use client';
+import {useState} from 'react';
import {VStack, HStack} from '@astryxdesign/core/Layout';
import {Button} from '@astryxdesign/core/Button';
import {Text, Heading} from '@astryxdesign/core/Text';
@@ -10,6 +11,7 @@ import {Badge} from '@astryxdesign/core/Badge';
import {Divider} from '@astryxdesign/core';
export default function Home() {
+ const [email, setEmail] = useState('');
return (
<main
style={{
@@ -65,7 +67,12 @@ export default function Home() {
{/* Text Input */}
<VStack gap={3}>
<Heading level={2}>Text Input</Heading>
- <TextInput label="Email address" placeholder="[email protected]" />
+ <TextInput
+ label="Email address"
+ placeholder="[email protected]"
+ value={email}
+ onChange={setEmail}
+ />
</VStack>
<Divider />