Use setState instead of replaceState