Yes, <Switch> can be used with <HashRouter>. <HashRouter> provides the routing context that <Switch> needs to function correctly.