Make a return type compatible with React 17
We really need to put a CI job in place to check our types against React 17 as long as we continue to support it, but for now let's fix this isolated type issue. (In React 17, undefined is not a valid return type for a functional component.)