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