git clone [email protected]:Sampath-vi/web-components.git
cd remote; npm install; npm run build;
- Copy thebuild/static/js/main*.js
path.- Replace the path in host.
- This repo consists of
host
andremote
. remote
is a react-app with a simple counter.host
is a html file which imports the build fromremote
and renders it.
- This app consists of a
Counter
component which will be reused in thehost app
. - The
Counter
component just increments the state locally. - The app is made available to the
host
using custom-elements - The app is being rendered via this function.