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

Add snippets for NORMAL functional components in tsx #12

Open
andriemc opened this issue Jun 28, 2024 · 4 comments
Open

Add snippets for NORMAL functional components in tsx #12

andriemc opened this issue Jun 28, 2024 · 4 comments

Comments

@andriemc
Copy link

I myself want to use function instead of const, but there isn't any snippets to do so (atleast in the tsx version)

@thetarnav
Copy link
Member

I can see that
feel free to propose some, if the snippets make sense I’ll add them

@andriemc
Copy link
Author

I can see that feel free to propose some, if the snippets make sense I’ll add them

scompf

function ${1:${TM_FILENAME_BASE}}() {

  return (
    <div>${1:${TM_FILENAME_BASE}}</div>
  );
}

export default ${1:${TM_FILENAME_BASE}};

scompif

import { Component } from "solid-js";

function ${1:${TM_FILENAME_BASE}}(props): Component<{$2}> {
  $0
  return <div></div>;
};

export default ${1:${TM_FILENAME_BASE}};

@thetarnav
Copy link
Member

I don't think function foo(props): Component<{}> is a valid component.
But I like the f suffix.

@andriemc
Copy link
Author

I don't think function foo(props): Component<{}> is a valid component. But I like the f suffix.

It is, in typescript (and thus tsx)

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

2 participants