r5n-dev / vscode-react-javascript-snippets

Extension for React/Javascript snippets with search supporting ES7+ and babel features

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lowercase React Component

Gabbydamian opened this issue · comments

Description

When using the extension in VS Code to generate a new React component, the component's name starts with a lowercase letter.

Steps to Reproduce

  1. Open a JavaScript or JSX file in VS Code.
  2. Type rafce to generate a new functional component.
  3. The generated component's name starts with a lowercase letter.

Expected Behavior

According to React's naming conventions, component names should start with an uppercase letter. I would expect the generated component's name to start with an uppercase letter.

Actual Behavior

The generated component's name starts with a lowercase letter.

Possible Solution

Modify the snippets to generate component names that start with an uppercase letter.

Additional Context

Here's an example of the current behavior:

import React from 'react'

function app() {
  return (
    <div>
      
    </div>
  )
}

export default app

Here's what I expected:

import React from 'react'

function App() {
  return (
    <div>
      
    </div>
  )
}

export default App

Works fine for Test.jsx, doesn't for Header.jsx