Fix component detaching

Detach component only if they are not rendered in client
Merge pull request #3 from mhafsaoui/patch-1

Fix component detaching