MMYes I totally agree with you , or even in this simple case we can use the useRef hook as an alternative also.Reply·Article·Sep 19, 2022·5 Pro Tips That Will Make You a Better React Developer
MMThanks for the useful article but I just have a note about your second tip about forms, in most cases we have to know the input of the user while he is typing in order to give him instant feedback about his input . So we have to use the first methodComment·Article·Sep 19, 2022·5 Pro Tips That Will Make You a Better React Developer