How can I detect click outside of the model?

I want to fire an event when I click outside of the model. I can handle event on click of the model but I need to detect click outside of the model. When I click outside of the model I want to fire an event that will reset the model. This is my code for handling click. How can I detect click outside of the mode? I’m using react three fiber. Please forgive my mistakes. I’m new in threejs. Thanks

      <group
        onDoubleClick={(e) => {
          e.stopPropagation();
          console.log("Click")
           // ResetAllOnFilterOff()
          // e.button === 0 && api.refresh().fit();
        }}
        onClick={(e) => {
          e.stopPropagation();
          onClickBuildingUnit(e);
        }}
      >
        {children}
      </group>