Write Sample component for tests with the new state based callbacks.