This fix comes when target (children) element sometimes renders null, so target will be null when popover componentDidMount is called making the popover to break.
An use case of this is a themed button, so it renders null until theme data is loaded asynchronously, so HTML won't appear in the UI until CSS is ready, instead of having the mark up rendered with no styles and this way we avoid UI flickering. So by the time popover is mounted it is not possible to get the target and when target element is clicked popover will break the whole page.
This change makes sure to calculate target every time the popover is updated.
This fix comes when target (children) element sometimes renders null, so target will be null when popover componentDidMount is called making the popover to break. An use case of this is a themed button, so it renders null until theme data is loaded asynchronously, so HTML won't appear in the UI until CSS is ready, instead of having the mark up rendered with no styles and this way we avoid UI flickering. So by the time popover is mounted it is not possible to get the target and when target element is clicked popover will break the whole page.
This change makes sure to calculate target every time the popover is updated.