Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
:electric_plug: Mount React components to the DOM using custom elements
Experimental - Remount lets you use your React components anywhere in the page as a web component (custom element).
yarn add remount
<x-greeter props-json='{"name":"John"}'></x-greeter>
Given this React component:
const Greeter = ({ name }) => {
return <div>Hello, {name}!</div>
}
Define it with:
import { define } from 'remount'
define({
'x-greeter': Greeter
})
Use it:
<x-greeter props-json='{"name":"John"}'></x-greeter>
<x-greeter name="John"></x-greeter>
Only the props-json
attribute is supported by default. To support custom properties like above, pass the names of attributes you want Remount to use.
import { define } from 'react-web-components'
define({
'x-greeter': {
component: Greeter,
attributes: ['name']
}
})
We recommend using these two polyfills to support browsers down to IE9 (~1.7kb gzipped), provided by the @webcomponents/webcomponentsjs
package. Load it via JavaScript in your app's entry point:
/*
* Add the package via: yarn add @webcomponents/webcomponentsjs
*/
import '@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js'
import '@webcomponents/webcomponentsjs/webcomponents-loader.js'
Or you can load it via CDN:
<script crossorigin src='https://cdn.jsdelivr.net/npm/@webcomponents/webcomponentsjs@2.0.4/custom-elements-es5-adapter.js'></script>
<script crossorigin src='https://cdn.jsdelivr.net/npm/@webcomponents/webcomponentsjs@2.0.4/webcomponents-loader.js'></script>
More info at the Polyfills documentation.
remount © 2018, Rico Sta. Cruz. Released under the MIT License.
Authored and maintained by Rico Sta. Cruz with help from contributors (list).
ricostacruz.com · GitHub @rstacruz · Twitter @rstacruz
FAQs
Mount React components to the DOM using custom elements
The npm package remount receives a total of 5,099 weekly downloads. As such, remount popularity was classified as popular.
We found that remount demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.