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

Allow <Form /> to optionally accept instance of createForm #101

Closed
1 task done
larrybotha opened this issue Feb 26, 2021 · 1 comment
Closed
1 task done

Allow <Form /> to optionally accept instance of createForm #101

larrybotha opened this issue Feb 26, 2021 · 1 comment
Labels

Comments

@larrybotha
Copy link
Collaborator

larrybotha commented Feb 26, 2021

Allow users to create an instance of createForm, and pass it to Form as a prop. This will ensure the user has access to all of the form methods and stores without having to bind to Form slot props.

e.g.

// Form.svelte
<script>
	// ...
	export let context = createForm(
		//...
	)

	// ...
</script>

Notes

  • onSubmit in Form would need to be assigned a default value, as use of context would make the prop redundant
    • how do we elegantly handle the conditionally required onSubmit?

Todo

  • ensure that all Form tests include user-defined context and default context variants

Related issues

@tjinauyeung
Copy link
Owner

🎉 This issue has been resolved in version 1.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

No branches or pull requests

2 participants