Shortcut to create structure for a React component in Vscode

Asked

Viewed 543 times

-1

I wonder if there is a shortcut in Vscode to automatically create the structure of a type component:

const { render } = require("react-dom");
import React from 'react';

import Time from './Time';
import Partida from './Partida';

export default class PlacarContainer extends React.Component {
   
    render() {
        return (
            
        );
    }
}

  • You can create your own snippets to do this. See vscode documentation to learn more.

  • Look for Rocketseat snippets in the extensions tab, they’re working on it for a while and they’ve got a lot of stuff ready.

1 answer

0

Vscode allows you to create your own shortcuts (scripts) and this structure described fits yes in a snippet that even contain variables (such as the name of smokes function, or the Imports, anyway, you who programs the snippet to fill it in the way that is most convenient. In this article (https://www.brasap.com.br/vs-code-criando-seus-proprios-snippets-de-codigo/) you find a tutorial that teaches you how to develop your own snippets whether they are for a set of languages, for a specific Workspace or for a single language. All this is configured and written in a simplified way in a JSON format file and there are also extensions of their own that implement snippets and that allow you to create even more simply.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.