I have some component like this
const Component = ({ oldPropName }) => ...
which I want to refactor to:
const Component = ({ newPropName }) => ...
and I want all occurrences of this oldPropName across all files to be changed automatically. Is there way to do this with VSCode?
Essentially same question can be asked as how to rename a destructured function parameter across the files without thinking about React components.
You can right click the oldPropName and there should be a "Rename Symbol" option or you can use F2. Some languages support rename symbol across files. Press F2 and then type the new desired name and press Enter. All usages of the symbol will be renamed, across files.