Abdullah-dev1 / react-portfoilo

https://muhammad-abdullah-portfolio-lovat.vercel.app
0 stars 0 forks source link

Improve Asset Management #1

Closed connect-bilal closed 5 days ago

connect-bilal commented 2 weeks ago

Description: Implement single-line import and export statements for images in image.js to simplify and streamline asset management. Example:

// src/assets/image.js
export { default as logo } from './logo.png';
export { default as banner } from './banner.jpg';

To use the assets after exporting them

// Importing the images
import { logo, banner } from '../assets/image';

function App() {
  return (
    <div>
      <img src={logo} alt="Logo" />
      <img src={banner} alt="Banner" />
    </div>
  );
}

export default App;

To improve readability and organization, you can give assets more descriptive names. banner, logo, profile-image etc