wix-incubator / vscode-glean

The extension provides refactoring tools for your React codebase

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incorrect handling of nested function params

borislit opened this issue · comments

Blocked By: #97

Example:

class Foo extends Component {

  render() {
    return (<div>
      {this.props.foo.map((bar) => <div>{bar.x}</div>)}
    </div>)
  }
}

Current:

 const Foo = props => {
   const foo = useRef();
   const x = useRef();
   return <div>
       {foo.current.map(bar => <div>{x.current}</div>)}
     </div>;
 };

Expected:

const Foo = props => {
  return <div>
      {props.foo.current.map(bar => <div>{bar.x}</div>)}
    </div>;
};