syntax for srcset in react

Solutions on MaxInterview for syntax for srcset in react by the best coders in the world

showing results for - "syntax for srcset in react"
Máximo
22 Apr 2020
1import nat1 from "./img/nat-1.jpg";
2import nat1Large from "./img/nat-1-large.jpg";
3import nat2 from "./img/nat-2.jpg";
4import nat2Large from "./img/nat-2-large.jpg";
5import nat3 from "./img/nat-3.jpg";
6import nat3Large from "./img/nat-3-large.jpg";
7
8
9  <div className="composition">
10                <img
11                  srcSet={`${nat1} 300w, ${nat1Large} 1000w`}
12                  sizes="(max-width: 56.25em) 20vw, (max-width: 37.5em) 30vw, 300px"
13                  alt="Photo 1"
14                  className="composition__photo composition__photo--p1"
15                  src={nat1Large}
16                />
17                <img
18                  srcSet={`${nat2} 300w, ${nat2Large} 1000w`}
19                  sizes="(max-width: 56.25em) 20vw, (max-width: 37.5em) 30vw, 300px"
20                  alt="Photo 2"
21                  className="composition__photo composition__photo--p2"
22                  src={nat2Large}
23                />
24                <img
25                  srcSet={`${nat3} 300w, ${nat3Large} 1000w`}
26                  sizes="(max-width: 56.25em) 20vw, (max-width: 37.5em) 30vw, 300px"
27                  alt="Photo 3"
28                  className="composition__photo composition__photo--p3"
29                  src={nat3Large}
30                />
31  </div>
32