I'm consistently having a problem with React / Javascript: often times, I want to anchor something on the close of a modal.
Example
<Popover/> component.Expected Behavior The popover component is rendered where the this button was clicked, enabling further action from the user.
Observed Behavior The popover component is still rendered, but an error is thrown in the console indicating that the anchor element is undefined.
I know that what's going on here is that the modal with the this and that buttons has now closed, so the Popover has nothing to anchor to. So, I'm wondering if there's an approach that would enable me to close the initial modal with the this and that buttons while still anchoring to the spot where one of the buttons was clicked. That's why I've titled this "manually setting currentTarget", because I'm wondering if there's a way to create this anchor or something like that.
Thanks for your help,
Davis