@raddo/easy-instagram-feed
v1.0.2
Published
An easy-to-use and simple Instagram package that allow you to fetch media content without API and access token.
Downloads
43
Maintainers
Readme
An easy-to-use and simple Instagram package that allow you to fetch media content without API and access token.
Install
$ npm install @raddo/easy-instagram-feed
or
$ yarn add @raddo/easy-instagram-feed
Usage
import React from "react";
import getInstagramFeed, {
InstagramFeedType,
} from "@raddo/easy-instagram-feed";
type InstaType = InstagramFeedType | null;
const Index: React.FC = () => {
const [instaFeed, setInstaFeed] = React.useState<InstaType>(null);
React.useEffect(() => {
getInstagramFeed("natgeotravel").then(feed => setInstaFeed(feed));
}, []);
if (!instaFeed) return null;
return (
<>
<h1>National Geographic Travel</h1>
<span>
It’s a big world. Explore it through the lens of our photographers.
</span>
{instaFeed.map((image, index) => (
<img
key={index}
src={image.src}
alt={image.alt}
onClick={() => window.open(image.url, "_blank")}
/>
))}
</>
);
};
Maintainer
| | | -------------------------------------------------------------------------------------------------------- |