I have used the following to get the url within a function component.
const Header = () => {
const url = typeof window !== 'undefined' ? window.location.href : '';
But I am looking to do the same for a class component so i can use Ternary.
Any idea how this can be done? I am struggling to find details outside of a functional component.