I didn’t find a clean solution. What you did can work as a workaround, but this is not very clean. The documentation tells that there should be a way to share data between before and after lifecycle hooks. So there is two possibilities:
- either the v4 documentation is not accurate on this point
- or there is an issue with the
event.stateproperty in v4