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

Improve snippet for TS Functional component #55

Merged
merged 3 commits into from
May 7, 2022
Merged

Improve snippet for TS Functional component #55

merged 3 commits into from
May 7, 2022

Conversation

carrotfarmer
Copy link
Contributor

Fixes Issue

Improves the snippet IMO

Before:

import React from "react";

interface IExampleProps {}

function Example({}: IExampleProps): JSX.Element {
  return <div></div>;
}

export default Example;

After:

import React from 'react'

interface ExampleProps {}

export const Example: React.FC<ExampleProps> = ({}) => {
    return ();
}

@avneesh0612
Copy link
Owner

Hey, this is cool but can you use FC directly and import fc from react like-

import type { FC } from "react"

and remove the react import. Thanks :)

@carrotfarmer
Copy link
Contributor Author

Yea sure

@carrotfarmer
Copy link
Contributor Author

Updated @avneesh0612

@avneesh0612 avneesh0612 merged commit b5a0f35 into avneesh0612:main May 7, 2022
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

Successfully merging this pull request may close these issues.

None yet

2 participants