# Self review: Displaying images - React Basic

1. **Is this code a correct way to import an image in React?**
    
    ```javascript
    import avatar from "./assets/avatar.png"
    
    function UserImage() {
       return ( 
          <div>
             <img 
                src={avatar}
                alt = "User image" 
             />
          < /div>
       )
    }
    export default UserImage;
    ```
    
    * Yes
        
    * <mark>No</mark>
        
2. **Is this code a correct way to import an image in React?**
    
    ```javascript
    function UserImage() {
       const avatarImg = "https://picsum.photos/400/265";
       return ( 
          <div>
                <img 
                      src="avatar.png"
                      alt="User image" 
                />
          </div>
       )
    }
    export default UserImage;
    ```
    
    * <mark>Yes</mark>
        
    * No
        
3. **What's wrong with this code?**
    
    ```javascript
    function ProfileImage() {
       const profileImg = "https://picsum.photos/400/265";
       return <img src={profileImg} alt="Profile image" />
    }
    export default ProfileImage;
    ```
    
    * <mark>Nothing. This code is correct.</mark>
        
    * There should be parentheses after the return keyword and the img element should spread its attributes over multiple lines.
        
    * You must surround the img element with a root, wrapping div element.
