refactor/render component in client code