Updated registerComponent to return the component