Skip to content

Allow nullish actions #13555

@kwangure

Description

@kwangure

Describe the problem

I'm frustrated when I have to use a noop action, as a placeholder while Svelte accepts nullish values in other places in the template.

Describe the proposed solution

Do not error when nullish actions are used.

<script>
	const foo = undefined;
</script>

<button onclick={foo}>foo</button>
<button class:foo>bar</button>
<!-- Error: foo is not a function  -->
<button use:foo>bar</button>

Importance

would make my life easier

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions