Components do not have to return JSX. Numbers, strings, and even null are valid return values.
If a function returns, code following that return statement is never executed. In the snippet you pasted, if
global.x is truthy, then the function returns, and the proceeding code is ignored. That means the
global.y is never accessed, because the function returned before
global.y would have been accessed. Since
global.y is never accessed, the component never subscribes to
global.x is falsey, then the component does not return early, and
global.y is accessed, making the component subscribe to changes in