79603464

Date: 2025-05-02 13:24:12
Score: 1
Natty:
Report link

Can also be done using useState in react. On clicking the button, the state changes, and depending on the state we show the textarea.

const [clicked, setClicked] = useState(false);
<Textarea
    placeholder="Add Your Note"
    className={`${clicked ? "visible": "collapse"}`}
  />
  <Button
    onClick={(e) => {
      setClicked(!clicked);
    }}
  >
    Add Note
  </Button>
Reasons:
  • Has code block (-0.5):
  • Starts with a question (0.5): Can also
  • Low reputation (1):
Posted by: Choudhary Himanshu