Skip to content

Commit

Permalink
fix: Duplicate key in Settings and Privacy (#11664)
Browse files Browse the repository at this point in the history
## **Description**

```
ERROR  Warning: Encountered two children with the same key, `0x89`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.
 ```

## **Related issues**

Fixes: No issue, found while developing

## **Manual testing steps**

1. Add Polygon, and add a custom RPC Polygon
2. Go to Network Settings
3. Should not see duplicate key error in logs

## **Screenshots/Recordings**

N/A

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable
- [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
  • Loading branch information
gambinish authored Oct 9, 2024
1 parent 368fc19 commit 9e3d268
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const IncomingTransactionsSettings = () => {
supportedNetworks[chainId as keyof typeof supportedNetworks].domain;
return (
<NetworkCell
key={chainId}
key={`${nickname}-${chainId}`}
name={name}
chainId={chainId as EtherscanSupportedHexChainId}
imageSource={image}
Expand All @@ -116,7 +116,7 @@ const IncomingTransactionsSettings = () => {
supportedNetworks[chainId as keyof typeof supportedNetworks].domain;
return (
<NetworkCell
key={chainId}
key={`${name}-${chainId}`}
name={name}
chainId={chainId as keyof typeof supportedNetworks}
imageSource={imageSource as ImageSourcePropType}
Expand Down

0 comments on commit 9e3d268

Please sign in to comment.