Skip to content

Instagram-embed not showing due to height being 0px #339

@Jay-Bruh

Description

@Jay-Bruh

Currently I'm using typescript along with react 17.0.2. I made a yarn add react-instagram-embed. I have a component called instagram.tsx where I'm using the following code:

import React from "react";
import InstagramEmbed from "react-instagram-embed";

export default function Instagram({ posts }) {
  return (
    <div >
      <InstagramEmbed
        url="https://instagr.am/p/Zw9o4/"
        maxWidth={600}
        hideCaption={false}
        containerTagName="div"
        protocol=""
        injectScript
        onLoading={() => {}}
        onSuccess={() => {}}
        onAfterRender={() => {}}
        onFailure={() => {}}
      />
    </div>
  );
}

But when I go to my webpage I cannot see the instagram post. I went to inspect element to check out the react developer tools and I could see the image components.

But when I hover over the components I get
image

I have tried adding height manually by adding style={{height:"400px"}} in the parent component and maxHeight in the instagramEmbed component but it still does not show up

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions