JSFiddle - React, Tailwind, and code Playground
HTML
<details>
<summary>Hello World</summary>
<p>
<a href="#" id="test">This link should close summary</a>
</p>
</details>
JavaScript
$(function(){
$('#test').on('click',function(){
$('details').prop('open', false)
});
});