Skip to content

Files

Latest commit

 

History

History
21 lines (13 loc) · 435 Bytes

jsx-img.md

File metadata and controls

21 lines (13 loc) · 435 Bytes

Pattern: Missing width/height for <img>

Issue: -

Description

For performance reasons, always provide width and height attributes for <img> elements, it will help to prevent layout shifts.

Examples

Example of incorrect code:

<img src="/static/images/portrait-01.webp">

Example of correct code:

<img width="200" height="600" src="/static/images/portrait-01.webp">