Some checks failed
No response / noResponse (push) Has been cancelled
CI / Continuous releases (push) Has been cancelled
CI / test-dev (macos-latest) (push) Has been cancelled
CI / test-dev (ubuntu-latest) (push) Has been cancelled
CI / test-dev (windows-latest) (push) Has been cancelled
Maintenance / main (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
31 lines
733 B
TypeScript
31 lines
733 B
TypeScript
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>
|
|
);
|
|
}
|