Skip to content

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.

2 participants