emptygif
Sprache: Deutsch

Alle Sprachen und Frameworks

React component (JSX) JavaScript

Ein JavaScript-Snippet für React component (JSX), das Anfragen an /pixel.gif mit dem leeren GIF beantwortet, das einmal beim Start dekodiert wird.

React component (JSX) JavaScript

Datei
Spacer.jsx
const EMPTY_GIF = 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==';

export function Spacer({ width = 1, height = 1, ...props }) {
  return <img src={EMPTY_GIF} width={width} height={height} alt="" aria-hidden="true" {...props} />;
}

Wir haben dieses Snippet ausgeführt und die zurückgegebenen Bytes verglichen.

Offizielle Website: React component (JSX)

Mehr in JavaScript