[MUI] TextField helperText 줄바꿈 Line break

이경은·2022년 10월 17일
0

How to

  • MUI TextField에서 helperText를 길게 두 문장으로 나누어 쓸 때 사용.
<TextField
    label="Dashboard Title"
    onChange={handleChange}
    required
    fullWidth
    value={title}
    error={error}
    helperText={
        <>
            This field is required. Only letters and numbers
            are allowed.
            <br />
            Space is not allowed at start. Special
            characters are not allowed.
        </>
    }
/>

적용 화면

참조

https://stackoverflow.com/questions/67264236/textfield-helpertext-spanning-multiple-lines
https://codesandbox.io/s/67264236textfield-helpertext-spanning-multiple-lines-8ul6k?file=/demo.tsx

profile
Web Developer

0개의 댓글