handle flash messages from ajax using React