Video details

Svelte Question - How to actually pass Svelte component through props?


How to actually pass Svelte component through props?
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
🎧 Svelte Tutorial for Beginners 🎧 Svelte Question Time
Related Resources Svelte Svelte REPL
🥰 Support me
Want to learn more from me? Check out these links:

Twitter: Blog: Newsletter:
#svelte #sveltequestiontime
Thanks for watching 🥰 -- with love, Li Hau