0.0.46 • Published 2 years ago

common-master-integration-react v0.0.46

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

common-master-mfe-integration

1.Reason

hook to integrate web component in minutes

2.React tutorial

  • install
  yarn add common-master-mfe-integration
  • define remote main.js,
  • input types and hook can get from this npm
import { useProjectMaster } from 'common-master-integration-react'

const props = {
  axios, fetch, routerFn, permissions, ...
}

export default function Page() {
  const [WebComponent] = useProjectMaster('http://localhost:3002/main.js')
  return <WebComponent title="1" name="2" {...props} />
}

3.Issues:

3.1.Missing ES5 class

  • you can see this error :
Uncaught TypeError: Failed to construct 'HTMLElement': Please use the 'new' operator, this DOM object constructor cannot be called as a function.
  • Add this polyfill into head of html to fix:
<script src="https://unpkg.com/@webcomponents/webcomponentsjs@2.0.3/custom-elements-es5-adapter.js"></script>
0.0.46

2 years ago

0.0.45

2 years ago

0.0.44

2 years ago

0.0.43

2 years ago

0.0.42

2 years ago

0.0.41

2 years ago

0.0.40

2 years ago

0.0.39

2 years ago

0.0.38

2 years ago

0.0.37

2 years ago