yash patel

yash patel

  • 1.5k
  • 283
  • 21k

Image is not Loading

Oct 28 2020 6:12 AM
I want to load a local image form the "assets" folder which is outside the source folder.
 
I have created a react app using create-react-app command.
  
I m having issues in loading the images.
 
i m not getting any error also but still the image is not loading
 
here is my code
  1. import React from 'react';  
  2. import ReactDOM from 'react-dom';  
  3. class MyForm extends React.Component {  
  4. render() {  
  5. return (  
  6. <div class="wrapper wrapper-login">  
  7. <div class="container container-login animated fadeIn">  
  8. <img src="./public/assets/img/logo.jpg" class="logo" alt="Logo" />  
  9. <form action="login" method="post">  
  10. <h3 class="text-center">Sign In</h3>  
  11. <div class="login-form">  
  12. <div class="form-group">  
  13. <label class="placeholder">Email</label>  
  14. <input type="text" class="form-control"></input>  
  15. </div>  
  16. <div class="form-group">  
  17. <label class="placeholder">Password</label>  
  18. <input type="password" class="form-control"></input>  
  19. </div>  
  20. <div class="form-group form-action-d-flex mb-3">  
  21. <input type="submit" value="Log In" class="btn btn-primary col-md-5 float-right mt-3 mt-sm-0 fw-bold"/>  
  22. </div>  
  23. <div class="login-account">  
  24. <span class="msg">Don't have an account yet ?</span>  
  25. <a href="SignUp" id="show-signup" class="link">Sign Up</a>  
  26. </div>  
  27. </div>  
  28. </form>  
  29. </div>  
  30. </div>  
  31. );  
  32. }  
  33. }  
  34.   
  35. ReactDOM.render(<MyForm />, document.getElementById('root'));  

Answers (3)