planbcoding/vscode-react-refactor

Please provide config setting for type of function to be created

Closed this issue · 2 comments

Thank you for this brilliant extension!

Since different teams have different conventions for this, would it be possible to add a "function-type" config-setting for the type of function that is being created?

For example:

Option 1: "function-type:": "arrow" (the current behaviour, and the default)

const ExtractedFunc = (props) => (
  <>
    <p>...</p>
    <p>...</p>
  </>
);

Option 2: "function-type:": "regular"

function ExtractedFunc(props) {
  return (
    <>
      <p>...</p>
      <p>...</p>
    </>
  );
}

Or as an alternative, provide two different context-menu entries for the two function types?

Implemented in the new version 1.1.0.

Thank you!