Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/franckgaudin/poc-wl-web-components

POC on transforming react components into web components
https://github.com/franckgaudin/poc-wl-web-components

Last synced: 12 days ago
JSON representation

POC on transforming react components into web components

Awesome Lists containing this project

README

        

## Transforming react components into web components

This is a simple example of how to transform a react component into a web component.
For this example, I'm using @r2wc/react-to-web-component library.

### How to run this project
1. Clone this repository
2. Run `pnpm install`
3. Run `pnpm dev` for testing the react component
4. Run `pnpm build` for building the web component
5. Use Go Live from VSCode to see the web component in action (/preview.html)

### How to use the web component
1. Include the script in your HTML file
```html

```
2. Use the web component in your HTML file
```html

```
3. import the css file in your HTML file
```html

```

### How to use the react component
1. Import the react component in your react project
```javascript
import { Ask } from './components/Ask';
```
2. Use the react component in your react project
```javascript

```