1.5.1614271328 • Published 3 years ago
attach-embeds-react v1.5.1614271328
Attach Embeds React
React components for Attach Embeds
Installation
npm
$ npm install --save attach-embeds attach-embeds-react
yarn
$ yarn add attach-embeds attach-embeds-react
Usage
import React from 'react'
import { attach, Reactions, Preview } from 'attach-embeds-react'
class App extends React.Component {
componentDidMount() {
if (!attach.isInitialized()) {
attach.setProperties({
'attach:item': `https://www.attach.live`,
'attach:reactions:hide-sections': ['comments', 'videos'],
})
attach.initialize()
}
}
render() {
return (
<>
<div>
<Reactions item="https://developers.attach.live" />
</div>
<div>
<Reactions properties={{ hide-sections: 'videos' }} />
</div>
<div>
<Preview />
</div>
</>
)
}
}
attach
Embeds API, convenient re-export from attach-embeds
Components
All components accept these common props:
className
,style
properties
- object, set properties local to the embeditem
- same as settingproperties={{ 'attach:item': '...' }}
Reactions
Renders the reactions embed.
Preview
Renders the preview embed.
1.5.1614271328
3 years ago
1.4.1581727501
4 years ago
1.3.1573429648-importfix2
4 years ago
1.3.1573429648-importfix
4 years ago
1.3.1573429648-prefix
4 years ago
1.3.1573429648
4 years ago