> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dynamic.xyz/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# mergeNetworks

<Card title="Recommended: JavaScript SDK with React Hooks" icon="react" color="#4779FE">
  For new React apps, we recommend the JavaScript SDK with React Hooks (`@dynamic-labs-sdk/react-hooks`) instead of the legacy React SDK documented here. The JS SDK comes with many benefits such as a much smaller bundle size and other optimizations. Use the [React quickstart (JavaScript SDK)](/javascript/reference/react-quickstart) to get started.
</Card>

## Summary

This utility function merges two arrays of `GenericNetwork` objects, with the first array taking precedence in case of a conflict. It is imported from `@dynamic-labs/sdk-react-core`.

## Annotation

```TypeScript theme={"system"}
export declare const mergeNetworks: (priorityNetworks: GenericNetwork[], secondaryNetworks: GenericNetwork[]) => GenericNetwork[];
```

## Example

It is commonly used when you declare [custom EVM networks](/react/chains/adding-custom-networks) or [custom SVM networks](/react/chains/adding-custom-networks) for Dynamic, and you want to merge them with the networks you get from the dashboard configurations:

```TypeScript theme={"system"}
import { mergeNetworks } from "@dynamic-labs/sdk-react-core";

const myEvmNetworks = [
    ...
]

const mySolNetworks = [
    ...
]

const DynamicSettings = {
  overrides: {
    evmNetworks: (networks) => mergeNetworks(myEvmNetworks, networks),
    solNetworks: (networks) => mergeNetworks(mySolNetworks, networks),
  }
};
```
