Added clearStateOnDestroy option for preserving state b/ween rerenders