Children in...
React
Link
// Parent Component
<User>
Front-end Developer
</User>
// Child Component
const User = (props) => {
return <p>{props.children}</p>
}
Vue
Link
// Parent Component
<User>
Front-end Developer
</User>
// Child Component
<template>
<slot>Display if no children passed</slot>
</template>
Svelte
Link
// Parent Component
<User>
Front-end Developer
</User>
// Child Component
<div>
<slot>Display if no children passed</slot>
</div>
Top comments (0)