my-react-lib-prashant 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my-react-lib-prashant",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "main": "dist/my-react-lib.js",
5
5
  "type": "module",
6
6
  "scripts": {
package/src/main.jsx CHANGED
@@ -1,10 +1,8 @@
1
- import { StrictMode } from 'react'
2
- import { createRoot } from 'react-dom/client'
3
- import './index.css'
4
- import App from './App.jsx'
1
+ import React from "react";
2
+ import ReactDOM from "react-dom";
3
+ import reactToWebComponent from "react-to-webcomponent";
4
+ import TextBox from "./TextBox";
5
5
 
6
- createRoot(document.getElementById('root')).render(
7
- <StrictMode>
8
- <App />
9
- </StrictMode>,
10
- )
6
+ const MyTextbox = reactToWebComponent(TextBox, React, ReactDOM);
7
+
8
+ customElements.define("my-textbox", MyTextbox);
@@ -1,12 +1,8 @@
1
1
  import React from "react";
2
2
  import ReactDOM from "react-dom";
3
3
  import reactToWebComponent from "react-to-webcomponent";
4
- import TextBox from "./components/TextBox";
4
+ import TextBox from "./TextBox";
5
5
 
6
- const TextBoxElement = reactToWebComponent(
7
- TextBox,
8
- React,
9
- ReactDOM
10
- );
6
+ const MyTextbox = reactToWebComponent(TextBox, React, ReactDOM);
11
7
 
12
- customElements.define("my-textbox", TextBoxElement);
8
+ customElements.define("my-textbox", MyTextbox);