rewrite with React