new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Mantine · all subjects

forms/use-form

2 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

useForm hook uncontrolled mode support

The @mantine/form useForm hook supports uncontrolled mode, which allows building large forms with good performance. In uncontrolled mode, useForm manages form state without requiring controlled inputs for each field.

useForm uncontrolled mode example

import { useState } from 'react'; import { Button, Code, Text, TextInput } from '@mantine/core'; import { hasLength, isEmail, useForm } from '@mantine/form'; function Demo() { const form = useForm({ mode: 'uncontrolled', initialValues: { name: '', email: '' }, validate: { name: hasLength({ min: 3 }, 'Must be at least 3 characters'), email: isEmail('Invalid email'), }, }); const [submittedValues, setSubmittedValues] = useState<typeof form.values | null>(null); return ( <form onSubmit={form.onSubmit(setSubmittedValues)}> <TextInput {...form.getInputProps('name')} key={form.key('name')} label="Name" placeholder="Name" /> <TextInput {...form.getInputProps('email')} key={form.key('email')} mt="md" label="Email" placeholder="Email" /> <Button type="submit" mt="md"> Submit </Button> <Text mt="md">Form values:</Text> <Code block>{JSON.stringify(form.values, null, 2)}</Code> <Text mt="md">Submitted values:</Text> <Code block>{submittedValues ? JSON.stringify(submittedValues, null, 2) : '–'}</Code> </form> ); } This example demonstrates using useForm in uncontrolled mode with validation. It shows how to initialize the form, use getInputProps and key methods, and track both current and submitted form values.

Give your agent this brain