Awesome
rpi.macro
Helper macro for react-precious-image
Usage
Similar to nodejs require
call:
import rpi from "rpi.macro";
const meta = rpi("./image.jpg");
Example of usage in create-react-app
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} />;
Credits
Based on pveyes/raw.macro.
License
MIT