1.0.0 • Published 4 years ago

react-only-office v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

react-only-office

React Only Office

NPM JavaScript Style Guide

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