Why You Need To Click Twice To Set State In React