wix-incubator / vscode-glean

The extension provides refactoring tools for your React codebase
MIT License
1.46k stars 56 forks source link

"Convert to Stateful Component" Error #29

Closed itzsaga closed 6 years ago

itzsaga commented 6 years ago

When I try to do "Convert Stateless to Stateful Component" on this code:

const DepositRow = ({
  depositPercentage,
  gridInputStyle,
  gridItemStyle,
  handleUpdate,
  total
}) => {
  const depositAmount = (total * (depositPercentage / 100)).toFixed(2);
  return (
    <Fragment>
      <div className={gridItemStyle}>Deposit %:</div>
      <input
        type="text"
        name="depositPercentage"
        value={depositPercentage}
        onChange={e => handleUpdate(e)}
        className={gridInputStyle}
      />
      <div className={gridItemStyle}>Deposit:</div>
      <div className={gridItemStyle}>${depositAmount}</div>
      <div />
    </Fragment>
  );
};

I get this error:

Using 4.0.4

borislit commented 6 years ago

@itzsaga Fixed by https://github.com/wix/vscode-glean/commit/e3bafd918bfdff4f5fae10b8dbf46622da7330b3

Please test on version 4.0.5

itzsaga commented 6 years ago

Works now. Awesome!