Closed pinggi closed 2 years ago
Thank you for your issue @pinggi, you are right this is an issue thank you very much.
@guillaume-chervet that's great you fixed it. I think you could have deleted also this code:
if(subscriptionId){
oidc.removeEventSubscription(subscriptionId);
}
useEffect
function is called and the cleanup
function returned from it registereduseEffect
dependencies are changed (in this case configuration
or configurationName
), the cleanup function is called first and then the useEffect
functionI also think the if(isMounted) {
check is also useless since it's not an async code that would run when the component is unmounted - it's indented like it would be part of the oidc.subscriveEvents
function but in fact it isn't.
Thank you again @pinggi , you are completly right again !
Hi will make a PullRequest Tomorrow.
Thnak you very much @pinggi, I close the PullRequest.
Issue and Steps to Reproduce
Shouldn't be oidc.removeEventSubscription(subscriptionId); called in useEffect cleanup function here?
Versions.
"@axa-fr/react-oidc-context": "^4.5.8"