Converts a React stateless functional component to a class component.