rewrite the react components