Simple Function refactored into a class

    
 const UserForm = () => {
        return (
            <form>
                <label>Enter a username:</label>
                <input />
            </form>
        );
    }
  
  

refactored into a class

    
   class UserForm extends React.Component {
        render() {
            return (    
                <form>
                    <label>Enter a username:</label>
                    <input />
                </form>
            );
        };

    }
  

Add your comment