Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lesson 20 - Prop Drilling #3

Open
robots4life opened this issue Feb 25, 2021 · 0 comments
Open

Lesson 20 - Prop Drilling #3

robots4life opened this issue Feb 25, 2021 · 0 comments

Comments

@robots4life
Copy link

Hi John

thank you heaps for your course. I noticed something in lesson 20 - Prop Drilling.

Even though

on:click="{removeSingleExpense(id)}"

works different in the tutorial deleting all the expenses and this because of different Svelte versions

https://svelte.dev/repl/075fd497f3bb45199c62775bf643379b?version=3.32.3
vs
https://svelte.dev/repl/075fd497f3bb45199c62775bf643379b?version=3.0.0

it is recommended to call the property/function exactly like that.

Of course

on:click="{(element) => {
			console.log(element)
			removeSingleExpense(id)
		}}"

also works fine.

Perhaps you can add a little info in form of an HTML file that explains this?

Took me and the Svelte Discord chat some time to figure out why your tut works different while having the exact same syntax. This issue was posted as related to the different syntax working in an earlier version of Svelte. sveltejs/svelte#4090

That might be confusing to students that pay good attention. 😉

Again, thank you for the course. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant