state management in pure react