How to clear state history without button click " clear history"?

Anyone have some ideia, please?