How to have selective contact shadows using r3f and drei

I want to add contact shadows to my scene but only on certain objects. I’ve tried disabling cast shadows etc but to no avail. I recently came accross this question about contact shadows on this forum. And I was interested in the last comment

In the example there is only one scene that holds all objs. That scene with its objects is used to make the contact shadow and is also used to render to screen.
To show shadows of certain objs only, you would need to remove those objs from the scene, before rendering the contact shadows and readd them before rendering to the screen.
Maybe its also possible to make obj.visible = false instead of removing them from the scene.

This makes perfect sense for vanilla three.js, but is there a way to do this declaratively with react three fiber and drei’s contact shadows? Or should I just do it inside useEffect?