A server-side utility component that allows you to add external scripts to your server-side render based on what components get rendered.
Client-side updates are currently not supported.
Built with React Side Effect.
npm install --save react-external-scripts
Let's say you want to render (parts) of your web app as an Outlook Add-In.
Wrap those parts in an
AddInContainer that adds the
office.js and dependencies
as external scripts.
import ExternalScripts from 'react-external-scripts'const AddInContainer = children<ExternalScripts =>children</ExternalScripts>
This example uses koa@2 and implements the server-side rendering of external scripts as a koa-middleware.
ExternalScripts.rewind() to collect all external scripts rendered in components
This project is licensed under the terms of the MIT License