You can create two custom hooks, one for creating a new drawer and returning its ref, and the other one for using it via drawer's id.