# Oddity with adjusting object query param values in multiple component instances

**URL:** <https://discuss.emberjs.com/t/oddity-with-adjusting-object-query-param-values-in-multiple-component-instances/12759>\
**Category:** Uncategorized\
**Created:** [April 11, 2017, 6:35pm UTC](https://discuss.emberjs.com/t/oddity-with-adjusting-object-query-param-values-in-multiple-component-instances/12759 "2017-04-11T18:35:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![revanar](https://avatars.discourse-cdn.com/v4/letter/r/46a35a/32.png) [@revanar](https://discuss.emberjs.com/u/revanar)\
**Post date:** [April 11, 2017, 6:35pm UTC](https://discuss.emberjs.com/t/oddity-with-adjusting-object-query-param-values-in-multiple-component-instances/12759/1 "2017-04-11T18:35:12Z")

</div>

I ran into a strange issue the other day while trying to create a component that could remove keys from a queryParam Object—When the components computed the new query param, they also had an effect on the existing query param, and on each other.

Here is a twitter that demonstrates:

> **[Ember Twiddle](https://ember-twiddle.com/#/06327b4b9158a4986560f8193da37aae?openFiles=components.delete-key.js%2Ctemplates.components.delete-key.hbs&route=%2F%3Fobj%3D%257B%2522first%2522%253A%255B%2522a%2522%252C%2522b%2522%252C%2522c%2522%255D%252C%2522second%2522%253A%255B%2522d%2522%252C%2522e%2522%255D%257D)**
>
> A web-based Ember.js code sharing tool that follows ember-cli's conventions.

Clicking the first button loads an object into the “obj” queryParam. When you click the second button, it loads an instance of the “delete-key” component for each key in “obj”. Since all the component contains is a computed value equals the current param with the given key removed from it, I would expect “First” to contain “Second”, and “Second” to contain “First”—in other words, for each call of the delete-key component to display everything but its own key/values. However, as you can see, the key that the first call of the delete-key component deletes persists over to the second key, resulting in no values being displayed, despite the fact that both instances of the component ought to be displaying a computed properties, and not modifying the original value passed to them.

In my Ember.js project, I also found by putting `console.log(params)` into my application route’s `model(params)` hook, that each time a component loaded, it was removing its key from the queryParam itself—but I have no idea why this would be happening, and I was unsuccessful in reproducing it in my twiddle.

Does anyone have a good explanation for why this is behaving the way it is, rather than the way I expected it to? Am I misunderstanding something about how components ought to work, or is this some sort of bug with queryParams? Any insight would be appreciated!
