
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@geops/create-react-web-component
Advanced tools
This project is a fork of the archived but great SimonHoiberg/create-react-web-component.
It includes the React 18 support and removed all cli and styled stuff.
In your project:
yarn add @geops/create-react-web-component
Creates the web-component using your React component:
import ReactWebComponent from "@geops/create-react-web-component";
import MyReactComponent from "./MyReactComponent";
const attributes = {
string: "default value",
}
const properties = {
object: { "key": "value"}
array: ["foo"]
}
ReactWebComponent.setAttributes(attributes);
ReactWebComponent.setProperties(properties);
ReactWebComponent.render(MyReactComponent, "my-web-component", { shadow: false });
Then load your module in a HTML page
<html>
<head>
<script type="text/javascript" src="your module bundle file"> </script>
</head>
<body>
<my-web-component id="myWebComponent" string="foo"></my-web-component>
<script>
const elt = doucment.getElementById('myWebComponent');
console.log(elt.string); // --> "foo"
console.log(elt.object); // --> "{ "key": "value" }"
console.log(elt.array); // --> "['foo']"
</script>
</body>
</html>
yarn install
yarn test
In the case of a bug report, bugfix or a suggestions, please feel very free to open an issue.
Pull requests are always welcome, and I'll do my best to do reviews as fast as I can.
This project is licensed under the MIT License
Read more about using Web Components with React on the official React Docs
FAQs
Create a web-component from a React component.
The npm package @geops/create-react-web-component receives a total of 78 weekly downloads. As such, @geops/create-react-web-component popularity was classified as not popular.
We found that @geops/create-react-web-component demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.