Myvideo

Guest

Login

How to actually pass Svelte component through props

Uploaded By: Myvideo
1 view
0
0 votes
0

How to actually pass Svelte component through props? ✨❓ Svelte Question Time ❓✨ “You have a Svelte question, I have an answer“ 😱😍 In the last video, , some of you are unimpressed with my take on passing component through props is to use named slots. Well, you are right! That's no passing component through props, it's more of passing element through props. In this video, we are going to explore how we can actually pass Svelte component through props. Introduction 00:00 We will start with a React component 01:07 Observing how it's done in React, and we are going to convert it to a Svelte component Converting React component to Svelte component 05:39 Using svelte:component 08:32 Svelte event listener on:input, instead of React's onChange 11:12 You can't spread event listeners in Svelte 13:38 Spreading attributes through $$restProps 15:03 Use component event for the dynamic Svelte component 16:38 Use props value binding for dynamic Svelte component 20:42 Summary 27:44 --- 🎧

Share with your friends

Link:

Embed:

Video Size:

Custom size:

x

Add to Playlist:

Favorites
My Playlist
Watch Later