Adding a utility method for injecting state into the form.