React components for Attach Embeds
npm
$ npm install --save attach-embeds attach-embeds-react
yarn
$ yarn add attach-embeds attach-embeds-react
importReactfrom'react'import{attach,Reactions,Preview}from'attach-embeds-react'classAppextendsReact.Component{componentDidMount(){if(!attach.isInitialized()){attach.setProperties({'attach:item': `https://www.attach.live`,'attach:reactions:hide-sections': ['comments','videos'],})attach.initialize()}}render(){return(<><div><Reactionsitem="https://developers.attach.live"/></div><div><Reactionsproperties={{hide-sections: 'videos'}}/></div><div><Preview/></div></>)}}Embeds API, convenient re-export from attach-embeds
All components accept these common props:
className,styleproperties- object, set properties local to the embeditem- same as settingproperties={{ 'attach:item': '...' }}
Renders the reactions embed.
Renders the preview embed.