Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/franckgaudin/poc-wl-web-components
- Owner: franckgaudin
- Created: 2024-08-02T18:21:51.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-08-02T18:37:25.000Z (4 months ago)
- Last Synced: 2024-08-06T17:12:36.539Z (3 months ago)
- Language: TypeScript
- Size: 43 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
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```