wait until react finishes rendering to continue processing input