Function for looking up a component registered to an element