confusedWarrior
confusedWarrior

Reputation: 1350

simple react snippet is not generating functional component with const

I am using this extension to generate code snippets when working with react.

In documentation it says when used fc abbreviation it should work as below.

fc - Function Component
const | = props => {
  return ( | );
};

export default |;

But, fc is not there only ffc is there which gives below snippet.

function | () {
  return ( | );
}

export default |;

Upvotes: 1

Views: 7694

Answers (2)

Nick Gr
Nick Gr

Reputation: 157

As far as I know this is the most common one and propobaly what most of vsc devs use: https://marketplace.visualstudio.com/items?itemName=dsznajder.es7-react-js-snippets

Try this one with the rafce snippet....

Upvotes: 4

John Kim
John Kim

Reputation: 11

ffc is for the functional component but sfc is for a stateless arrow function component. sfc will work in your case

Upvotes: 0

Related Questions