@aarnila/react-instagram-embed 中文文档教程

发布于 3年前 浏览 22 项目主页 更新于 3年前

react-instagram-embed

npm versionLicense

React embedding Instagram posts component

注意:这个包是从 https://github.com/sugarshin/react-instagram-embed 派生出来的

更改为使用新的 Instagram Oembed API: https://developers.facebook.com/docs/instagram/oembed

yarn add @aarnila/react-instagram-embed

# or

npm i @aarnila/react-instagram-embed

存储库包含演示应用程序,但它需要有效的访问令牌才能工作。

Usage

import InstagramEmbed from '@aarnila/react-instagram-embed';

<InstagramEmbed
  url='https://instagr.am/p/Zw9o4/'
  accessToken='123|456'
  maxWidth={320}
  hideCaption={false}
  containerTagName='div'
  protocol=''
  injectScript
  onLoading={() => {}}
  onSuccess={() => {}}
  onAfterRender={() => {}}
  onFailure={() => {}}
/>

访问令牌是 App Id 和客户端令牌的组合。 有关详细信息,请参阅 https://developers.facebook.com/docs/instagram/oembed/#access-tokens。

props

  • url {String} Instagram URL. Required
  • accessToken {String} Instagram Client Access Token. Required
  • maxWidth {Number} Max width. Minimum size is 320. Default undefined
  • hideCaption {Boolean} Default false
  • containerTagName {String} Default 'div'
  • protocol {String} Instagram API script protocol. Default '' same as current protocol
  • This property needed if you use device's file system, for example, Electron, Cordova apps
  • injectScript {Boolean} Default true
  • onLoading {Function}
  • onSuccess {Function}
  • onAfterRender {Function}
  • onFailure {Function}

License

麻省理工学院

© sugarshin

[circleci-image]:https://circleci.com/gh/sugarshin/react-instagram-embed/树/master.svg?style=svg&circle-token=8991301b0db526852c58dc884a349cb8e00f1b24 [circleci-url]:https://circleci.com/gh/sugarshin/react-instagram-embed/tree/master

react-instagram-embed

npm versionLicense

React embedding Instagram posts component

Note: this package is forked from https://github.com/sugarshin/react-instagram-embed

Changed to use the new Instagram Oembed API: https://developers.facebook.com/docs/instagram/oembed

yarn add @aarnila/react-instagram-embed

# or

npm i @aarnila/react-instagram-embed

Repository contains demo app but it would require a valid access token to work.

Usage

import InstagramEmbed from '@aarnila/react-instagram-embed';

<InstagramEmbed
  url='https://instagr.am/p/Zw9o4/'
  accessToken='123|456'
  maxWidth={320}
  hideCaption={false}
  containerTagName='div'
  protocol=''
  injectScript
  onLoading={() => {}}
  onSuccess={() => {}}
  onAfterRender={() => {}}
  onFailure={() => {}}
/>

Access token is combination of App Id and Client Token. See https://developers.facebook.com/docs/instagram/oembed/#access-tokens for more details.

props

  • url {String} Instagram URL. Required
  • accessToken {String} Instagram Client Access Token. Required
  • maxWidth {Number} Max width. Minimum size is 320. Default undefined
  • hideCaption {Boolean} Default false
  • containerTagName {String} Default 'div'
  • protocol {String} Instagram API script protocol. Default '' same as current protocol
  • This property needed if you use device's file system, for example, Electron, Cordova apps
  • injectScript {Boolean} Default true
  • onLoading {Function}
  • onSuccess {Function}
  • onAfterRender {Function}
  • onFailure {Function}

License

MIT

© sugarshin

[circleci-image]: https://circleci.com/gh/sugarshin/react-instagram-embed/tree/master.svg?style=svg&circle-token=8991301b0db526852c58dc884a349cb8e00f1b24 [circleci-url]: https://circleci.com/gh/sugarshin/react-instagram-embed/tree/master

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文