solid-snippets icon indicating copy to clipboard operation
solid-snippets copied to clipboard

Add snippets for NORMAL functional components in tsx

Open andriemc opened this issue 1 year ago • 4 comments

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

andriemc avatar Jun 28 '24 13:06 andriemc

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

thetarnav avatar Jun 28 '24 16:06 thetarnav

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}};

andriemc avatar Jun 28 '24 18:06 andriemc

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

thetarnav avatar Jun 28 '24 19:06 thetarnav

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)

andriemc avatar Jun 29 '24 07:06 andriemc