tdh-react-library
v1.0.4
Published
Small React library that exposes a header HTML and render function
Readme
tdh-react-library
Small demo React library that exposes a header HTML string and a render function.
Build:
cd packages/tdh-react-library
npm install
npm run buildThis produces dist/index.umd.js (UMD) and dist/index.esm.js (ESM).
Publishing:
- Make sure
namein package.json is unique on npm. npm loginnpm publish --access public
After publish you can load from unpkg/jsdelivr, for example:
UMD URL:
https://unpkg.com/[email protected]/dist/index.umd.jsIn the Angular app we call DynamicReactService.loadAndMountHtml('tdh-react-library', '.dynamic-header-container', { cdn: 'unpkg', version: '1.0.0', path: '/dist/index.umd.js', global: 'TdhReactLibrary' }) to load and mount the header.
