Svelte Question - How to call functions in parent component
✨❓ Svelte Question Time ❓✨
“You have a Svelte question, I have an answer“ 😱😍
Introduction 00:00
What is the relationship between the component and its parent 01:22
There’s no one size fit all solution for this. It’s better to study the relationship between the components and figure out what’s the best way of communication between the components
Example 1 - Passing the function as a props 05:53
Useful when the component can’t live without parent, and the parent can’t live without the component
Example 2 - Passing the function as listener for component events 07:13
Useful when you the component does not care about the function, whether the function is being passed to the component or not.
Example 3 - Passing the function via context 10:10
Useful when all the children and grandchildren components may or may not call the function. The function allows all children and grandchildren components to update the state / make changes to the common parent component.
---
📝 Svelte REPL
3 views
438
225
5 months ago 01:01:48 2
Preparing Svelte Frontend Interview
6 months ago 01:01:01 3
The Value of TypeScript × Vue vs Svelte × Leetcode
3 years ago 00:21:03 2
How to use Svelte store in .js file?
3 years ago 00:25:53 1
Svelte components communicate without store / props / context?
3 years ago 00:28:32 1
How to actually pass Svelte component through props?
3 years ago 00:04:49 1
How to pass Svelte component through props?
3 years ago 00:50:38 1
How to use Svelte component inside a React app?
3 years ago 00:15:14 1
Why do we need createEventDispatcher?
4 years ago 00:38:44 1
Svelte Question - How to create dynamic elements
4 years ago 00:15:48 1
Svelte Question - What is component initialisation
4 years ago 00:14:03 3
Svelte Question - How to call functions in parent component
4 years ago 00:10:34 2
Svelte Question - Is Svelte props passed by reference or by value
4 years ago 00:12:04 2
Supabase & Sveltekit - Auth w/ Cookies 🍪 (Part 3.5)
4 years ago 00:08:32 1
Svelte Question - How to call functions inside a component
4 years ago 00:21:08 3
Creating a paginated blog with server side rendering (SSR) support using Svelte and Sapper
4 years ago 01:00:10 2
How to build a website using svelte that controls an Arduino & Led Matrix with
5 years ago 00:29:36 6
Svelte Society Day 2020: Rich Harris: Frequently Asked Questions
5 years ago 00:07:14 1
Merging Authenticated Users table with Database Users - Svelte Fullstack Starter - Part 14
5 years ago 01:59:38 3
Svelte live coding & demo at SpinSpire office
5 years ago 00:04:34 1
The Sapper blog/ page explained. (?, [slug].svelte??, ???)