react-only-office
v1.0.0
Published
React Only Office
Downloads
147
Readme
react-only-office
React Only Office
Install
npm install --save react-only-office
yarn add react-only-office
Usage
import React from 'react'
import OnlyOffice, { useOnlyOffice, OODocument } from 'react-only-office'
// @see https://api.onlyoffice.com/editors/advanced
const config = {...}
const Example = () => {
render () {
return (
<OnlyOffice {...config}>
<span>Only Office:</span>
<MyComponent/>
</>
)
}
}
const MyComponent = () => {
const { getDownloadUrl } = useOnlyOffice();
return <button onClick={async ()=>{
const url = await getDownloadUrl();
window.open(url)
}}>Download file!</button>
}
License
MIT © nlopezm