Why error message doesn't conditionally render? – Reactjs
username state const [username, setUsername] = useState({ name: "", isValid: true, error_message: "start with a letter n allowed characters: a-z A-Z 0-9 - and _ ", }); handle username function function handleUsername(e) { const regexp = new RegExp(/[a-zA-Z][a-zA-Z0-9-_]{5,32}/gi); const name…