Hook that runs a function only once on component mounting.
React's useEffect hook runs all effects twice when in strict mode to check for bugs.
They do this to check whether the component mounting is idempotent and allows for mounting multiple times without
issues.
React argues that APIs should not be called when rendering the page, but in our case this is needed to handle OAuth
and logout flows, and so this effect is required as a workaround.
Hook that runs a function only once on component mounting.
React's useEffect hook runs all effects twice when in strict mode to check for bugs. They do this to check whether the component mounting is idempotent and allows for mounting multiple times without issues.
React argues that APIs should not be called when rendering the page, but in our case this is needed to handle OAuth and logout flows, and so this effect is required as a workaround.