Maybe move this function to its own module and require() it from ReactMount and here?