DEV Community

Discussion on: My React Functional Component maker for the terminal

Collapse
sphrases profile image
sphrases • Edited on

Hey Lucas welcome here. Very nice and high quality first post :D

A similar approach for saving your time with boilerplates could be live templates (For the Jetbrains ecosystem; There might be different names for the same things in other IDEs.). They take a shortcut and replace it with you boilerplate of choice ;)
This is the rfc (react function component) template for example:

import React from 'react';
const $COMPONENT$ = ($PARAMETER$) => {
  return (
    <div>$END$</div>
  );
}

export default $COMPONENT$;

This improved my quality of (code) life immensely. :)
This doesn't create the folder structure like you showed, so it might not fit the same use case.

Collapse
nomade55 profile image
Lucas G. Terracino Author

Thank you for the kind words!

This is genius, I've never thought of using Snippets (This is how is called in VSCode and I think so does in Sublime), I went ahead and created a script, and while doing so I thought, I should just create the whole folder! The use case grow larger while I was writing it haha.
But this looks very efficient next time I only need a file.