/
githubmirror
/
material-ui
Обзор
Документация
Войти
/
githubmirror
/
material-ui
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
docs/data/material/components/text-fields/StateTextFields.tsx
30 строк
733 B
Siriwat K
[docs] Migrate system props to `sx` prop (#42475)
05 июн 2024, 06:04
Не верифицирован
05 июн 2024, 06:04
6fe1242
Код
Авторство
О чём код?
import * as React from 'react'; import Box from '@mui/material/Box'; import TextField from '@mui/material/TextField'; export default function StateTextFields() { const [name, setName] = React.useState('Cat in the Hat'); return ( <Box component="form" sx={{ '& > :not(style)': { m: 1, width: '25ch' } }} noValidate autoComplete="off" > <TextField id="outlined-controlled" label="Controlled" value={name} onChange={(event: React.ChangeEvent<HTMLInputElement>) => { setName(event.target.value); }} /> <TextField id="outlined-uncontrolled" label="Uncontrolled" defaultValue="foo" /> </Box> ); }