1.0.2 • Published 4 years ago

@raddo/easy-instagram-feed v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

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")}
        />
      ))}
    </>
  );
};

alt text

Maintainer

Radovan Pelka (Rado)

| Radovan Pelka