'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 |;
Solution 1:[1]
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.
Solution 2:[2]
ffc is for the functional component but sfc is for a stateless arrow function component. sfc will work in your case
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | |
Solution 2 | John Kim |