score:1

Accepted answer

there's a ton of vscode extensions that can accomplish this. these are referred to as "snippets", and you can find tons of snippet extensions in the vscode extension marketplace.

one example is the es7 react/redux/graphql/react-native snippets extension by dsznajder.

the extension will allow you to do something like you example, which turns nfn into const functionname = (params) => { }.


as your question also asks, you can generate component's scaffolding by typing rce.

this will autocomplete to the following:

import react, { component } from 'react'

export class filename extends component {
  render() {
    return <div>$2</div>
  }
}

export default $1

Related Query

More Query from same tag