Closed as not planned
Description
Describe the bug
I use export const
to expose component methods and Svelte's behavior changed with the 3.54 release (probably because of Prevent running init binding unnecessarily).
It looks roughly like this:
Parent.svelte:
<script>
let closeModal = () => {}
</script>
<Modal bind:closeModal />
<!-- Since Svelte 3.54, clicking this button does nothing -->
<button on:click={closeModal}>close</button>
Modal.svelte
<script>
export const closeModal = () => { /* ... */ }
</script>
It used to work with Svelte <= 3.53.1.
I'm not sure if this is the best way to implement this kind of behavior, any advice would be welcome.
Related: #8168
Suspected breaking change: (edited) #7981
Reproduction
- Always works: https://svelte.dev/repl/2ca58f269fa3486d83abc9cea27ad27c?version=3.53.1
- Does not work with a default value: https://svelte.dev/repl/2ca58f269fa3486d83abc9cea27ad27c?version=3.54.0
Logs
No response
System Info
-
Severity
annoyance
Metadata
Metadata
Assignees
Labels
No labels