2.0.0 Release!
·
43 commits
to main
since this release
Simplified API, Typescript support, and more! See https://www.bitovi.com/blog/react-to-web-component-v2 for all the new features.
The API for react-to-web-component is now easier than ever! No more need to pass in React and ReactDOM as they are now treated as peer dependencies. The use of PropTypes has also been replaced with a dedicated props object when creating the Web component. See the example below.
import r2wc from "@r2wc/react-to-web-component"
const WebGreeting = r2wc(Greeting, {props: ["name"] }) // or { props: { name: "string" } }
customElements.define("web-greeting", WebGreeting)