Video details

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

Svelte
06.10.2021
English

How to actually pass Svelte component through props?
In the last video, https://youtu.be/-tYrLmzMsWE, 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 https://www.youtube.com/playlist?list=PLoKaNN3BjQX3mxDEVG3oGJx2ByXnue_gR 🎧 Svelte Question Time https://www.youtube.com/playlist?list=PLoKaNN3BjQX1I9FmIoCaws4vUaoqezpc1
📚
Related Resources Svelte https://svelte.dev Svelte REPL https://svelte.dev/repl
🥰 Support me https://www.buymeacoffee.com/lihautan
🔗
Want to learn more from me? Check out these links:

Twitter: https://twitter.com/lihautan Blog: https://lihautan.com/ Newsletter: https://lihautan.com/newsletter
#svelte #sveltequestiontime
Thanks for watching 🥰 -- with love, Li Hau