react-boostrap Dropdown.Item custom jsx on clicking the item the dropdown does not close

i am trying to create a drop-down component where the user on clicking on a custom item, some code will be executed and then the dropdown will close.

Here is an example of what i am trying to achieve.
https://codesandbox.io/s/react-bootstrapp-checkbox-dropdown-entcq

I am using react-bootstrap and react-bootstrap dropdown (https://react-bootstrap.github.io/components/dropdowns/).

Thank you in advance,
Andreas