Question: I've used React Router like below:

```
<BrowserRouter>
<Switch>
  <Route exact path="/" component={Login} />
  <Route exact path="/home"  component={HomeComponent}/>
</Switch>
</BrowserRouter>

```

When I use **this.props.history.push("/home")** or **http://localhost:3000/home** page is Moving to Home page, but the url is still http://localhost:3000/.
Routing is working and I am able to navigate to all pages, but in the Top URL bar it is showing http://localhost:3000/ always.

Any Idea why this happens?

Answer: 
By this

```
list2 = list1;

```

you are not actually making a copy of `list1`. It is the same list being assigned to `list2` too.

So you need to change to this.

```
list2 = [...list1];

```
You can use **spread** operation:

```
list2 = [...list1];

```

That should allow any iterable to copy the values instead of using the reference.