rpi.macro
v0.1.1
Published
Helper macro for react-precious-image
Downloads
3
Maintainers
Readme
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