Skip to content

Conversation

pixelmund
Copy link
Contributor

Sorry for reopening this again, was not happy because i didn't create a feature branch in my fork.

Those are the type definitions for svelte-forms-lib, there might be some optimizations but it's a good starting point.

Svelte currently does not support generics in components, there are some discussions around it but i couldn't find a solution.
For now we can use it like this:

import type {FormProps} from "svelte-forms-lib";

const formProps : FormProps = {
      initialValues: { name: "", email: "" },
      onSubmit: values => {
        /// values are inferred from initialValues
        alert(JSON.stringify(values));
      }
    };

fix #81

Copy link
Collaborator

@tiaanduplessis tiaanduplessis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @pixelmund ! LGTM

@larrybotha larrybotha merged commit 3c46bc1 into tjinauyeung:master Feb 15, 2021
@larrybotha
Copy link
Collaborator

@pixelmund excellent, thanks for this!

@tjinauyeung
Copy link
Owner

🎉 This PR is included in version 1.7.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

Successfully merging this pull request may close these issues.

Typescript defs?
4 participants