Helper macro for react-precious-image
Similar to nodejs require
call:
import rpi from "rpi.macro";
const meta = rpi("./image.jpg");
import React from "react";
import rpi from "rpi.macro";
import { AdaptiveLoad } from "react-precious-image";
import image from "./images/doggo.jpg";
const meta = rpi("./doggo.jpg");
const App = () => <AdaptiveLoad src={image} alt="doggo" {...meta} />;
Based on pveyes/raw.macro.
MIT