PascalCase React Snippet in VS Code

76 views Asked by At

I am using the "ES7+ React/Redux/React-Native snippets" extension VS Code. I like to use rfc to generate a React functional component based on the name of the file. The issue is I want to use Next.js / next router to handle my pages.

I want the route the browser hits to be /blah/this-is-the-page so the file needs to be /pages/blah/this-is-the-page.tsx. If I run the rfc snippet from this file it creates a function called this-is-the-page ie export default function this-is-the-page() {. The preferred behavior, when there are dashes in the file name, would be to use PascalCase like this: ThisIsThePage ie export default function ThisIsThePage() {.

Is there a way to customize or indicate to this snippet extension to use PascalCase in this situation?

https://marketplace.visualstudio.com/items?itemName=dsznajder.es7-react-js-snippets

0

There are 0 answers