목록2024/08/20 (2)
juni

const [error, setError] = useState('');상태를 문자열이 아닌 JSX 요소로 처리하도록 변경하거나, 상태는 문자열로 유지하고 렌더링 단계에서 JSX 요소로 변환하여 아래 코드 처럼 함수 내에서 html 태그 사용 if (value.length >= 15 && !isMobile) { setError(Nickname cannot exceed 15 characters.); } else { setError(''); } let toastId = null; const handleNicknameChange = (e: React.ChangeEvent) => { const value = e.target.value; const isMobi..

SweetAlert2의 customClass에서 bg-* 클래스는 제대로 적용되지만, text-* 클래스가 예상대로 동작하지 않는 경우가 있을 수 있습니다. 이 문제는 SweetAlert2의 HTML 구조와 Tailwind CSS의 유효성 검사 또는 적용 방식 사이의 차이에서 발생할 수 있습니다. const result = await MySwal.fire({ title: 'Do you want to delete your post?', text: 'If you delete, you can always rewrite it later', icon: 'warning', showCancelButton: true, confirmButtonText: 'Delete ..