Reputation: 39018
Trying to rename this variable: assetPayoutType
to just payType
, however because I'm working in TypeScript there is a problem. TypeScript thinks there is a type called payType
.
const { title, assetPayoutType } = this.props;
mapDailyAssets(assetPayoutType: string)
IE: This won't work:
mapDailyAssets(assetPayoutType: payType: string)
I searched on StackOverflow and found two answers that did not answer this question.
Answer describes a non-typescript / regular Javascript simple rename:
Renaming remaining properties variable when object destructuring in TypeScript
This answer is about VSCode refactoring:
Upvotes: 8
Views: 10637
Reputation: 470
type
is protected word (keyword) in Typescript
also:
const { title, assetPayoutType: payoutType } = this.props;
Upvotes: 11