r5n-labs / vscode-react-javascript-snippets

Extension for React/Javascript snippets with search supporting ES7+ and babel features
MIT License
1.74k stars 442 forks source link

Lowercase React Component #314

Closed Gabbydamian closed 11 months ago

Gabbydamian commented 11 months ago

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
Gabbydamian commented 11 months ago

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