@aarnila/react-instagram-embed 中文文档教程
react-instagram-embed
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. RequiredaccessToken
{String} Instagram Client Access Token. RequiredmaxWidth
{Number} Max width. Minimum size is320
. Defaultundefined
hideCaption
{Boolean} Defaultfalse
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} Defaulttrue
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
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. RequiredaccessToken
{String} Instagram Client Access Token. RequiredmaxWidth
{Number} Max width. Minimum size is320
. Defaultundefined
hideCaption
{Boolean} Defaultfalse
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} Defaulttrue
onLoading
{Function}onSuccess
{Function}onAfterRender
{Function}onFailure
{Function}
License
© 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