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.
@egoist/vue-to-react
Advanced tools
This works for both Vue 2 and Vue 3.
yarn add @egoist/vue-to-react
import React from 'react'
import { render } from 'react-dom'
import toReact from '@egoist/vue-to-react'
const VueComponent = {
data() {
return {
count: 0
}
},
render(h) {
return h(
'button',
{
on: {
click: () => this.count++
}
},
[this.count]
)
}
}
const ReactComponent = toReact(VueComponent)
render(<ReactComponent />, document.getElementById('app'))
By default we pass all props from React to Vue:
const Counter = toReact({
props: ['initialCount'],
render(h) {
return h('button', {}, [this.initialCount])
}
})
const App = <Counter initialCount={0} />
However you can customize how the props are passed to Vue with the passProps
option:
toReact(VueComponent, {
// Only pass `initialCount` prop
passProps: props => ({ initialCount: props.initialCount }),
// Or disable props
passProps: false
})
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
@egoist/vue-to-react © EGOIST, Released under the MIT License.
Authored and maintained by EGOIST with help from contributors (list).
github.com/egoist · GitHub @EGOIST · Twitter @_egoistlily
FAQs
Turn a Vue component into a React component.
The npm package @egoist/vue-to-react receives a total of 13,664 weekly downloads. As such, @egoist/vue-to-react popularity was classified as popular.
We found that @egoist/vue-to-react 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.