![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
portal-vue
Advanced tools
> A Portal Component for Vue 3, to render DOM outside of a component, anywhere in the document.
portal-vue is a Vue.js plugin that allows you to render a component's template in a different part of the DOM tree. This can be particularly useful for creating modals, tooltips, and other UI elements that need to be rendered outside of their parent component's DOM hierarchy.
Basic Portal
This feature allows you to move a piece of the template to another part of the DOM. The `portal` component is used to specify the content to be moved and the `to` attribute specifies the target element.
<template>
<div>
<portal to="destination">
<p>This content will be teleported to the destination element.</p>
</portal>
<div id="destination"></div>
</div>
</template>
<script>
import { Portal } from 'portal-vue';
export default {
components: {
Portal
}
};
</script>
Named Portals
Named portals allow you to manage multiple portals more easily by giving each portal a unique name.
<template>
<div>
<portal to="destination" name="example">
<p>This content will be teleported to the destination element with a specific name.</p>
</portal>
<div id="destination"></div>
</div>
</template>
<script>
import { Portal } from 'portal-vue';
export default {
components: {
Portal
}
};
</script>
Scoped Slots
Scoped slots allow you to pass data from the parent component to the teleported content, making it more dynamic and interactive.
<template>
<div>
<portal to="destination" v-slot="props">
<p>{{ props.message }}</p>
</portal>
<div id="destination"></div>
</div>
</template>
<script>
import { Portal } from 'portal-vue';
export default {
components: {
Portal
},
data() {
return {
message: 'This is a scoped slot message.'
};
}
};
</script>
react-portal is a React library that provides similar functionality to portal-vue for React applications. It allows you to render children into a DOM node that exists outside the DOM hierarchy of the parent component.
A Portal Component for Vue 3, to render DOM outside of a component, anywhere in the document.
For more detailed documentation and additional Information, please visit the docs.
Looking for the version for Vue 2.*? Docs for PortalVue 2.*, compatible with Vue 2, are here
npm i portal-vue
# or
yarn add portal-vue
import PortalVue from 'portal-vue'
Vue.use(PortalVue)
<portal to="destination">
<p>This slot content will be rendered wherever the <portal-target> with name 'destination'
is located.</p>
</portal>
<portal-target name="destination">
<!--
This component can be located anywhere in your App.
The slot content of the above portal component will be rendered here.
-->
</portal-target>
Add portal-vue/nuxt
to modules section of nuxt.config.js
{
modules: ['portal-vue/nuxt']
}
FAQs
> A Portal Component for Vue 3, to render DOM outside of a component, anywhere in the document.
The npm package portal-vue receives a total of 374,533 weekly downloads. As such, portal-vue popularity was classified as popular.
We found that portal-vue 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.