Sample WebComponent/CustomElement wrapper for React Components
- Clone the repository
- Run
npm installto get the dependencies - Source code is part of
srcfolder. - The project uses OMDN API to fetch posters. Please get an API key from OMDB.
- Update the API key in
src/react-poster-widget.js
- Run
npm run serveto generate the local url for preview
- Run
npm run buildto build the babel transpiled output. - Post build, output files will be generated in the
libfolder. - React Component code will be in
lib/react-poster-widget.min.js - WebComponent/Custom Element Wrapper will be in
lib/react-poster-custom-element-wrapper.min.js. - Use the above two files in your HTML to consume.