Back to Browse

How to create a web component in React

15.4K views
Mar 1, 2020
10:49

Demo of creating and using a web component using React. We use the npm package 'react-to-webcomponent' to wrap our React component and turn it into a WebComponent. An additional step is needed to get attributes working and that is to use the npm package prop-types and then define our properties so as to hook them up. All written using Visual Studio code with a helping hand from the 'Parcel' bundler which transpiles the JSX for us and also does all the npm installs automatically.

Download

0 formats

No download links available.

How to create a web component in React | NatokHD