> ## 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.

# useRpcProviders

> [card] Recommended: JavaScript SDK with React Hooks
>
> 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)](https://docs.dynamic.xyz/docs/javascript/reference/react-quickstart.md) to get started.

### Summary

This hook provides access to EVM and Solana RPC providers.

> [!NOTE]
>
> Check out our guide on [Using RPC Providers](https://docs.dynamic.xyz/docs/react/chains/rpc-urls.md)

### Usage

This hook must be fed with an RPC provider selector, of which you can chose among two:

* `evmProvidersSelector`, exported from `@dynamic-labs/ethereum-core`
* `solanaProvidersSelector`, exported from `@dynamic-labs/solana-core`

```typescript theme={"system"}
import { useRpcProviders } from '@dynamic-labs/sdk-react-core'
import { evmProvidersSelector } from '@dynamic-labs/ethereum-core'
import { solanaProvidersSelector } from '@dynamic-labs/solana-core'

const App = () => {
  const evmProviders = useRpcProviders(evmProvidersSelector)
  const solanaProviders = useRpcProviders(solanaProvidersSelector)
}
```

### Return Value

This hook's return value depends on the selector with which it was fed:

* [EvmRpcProviderMethods](https://docs.dynamic.xyz/docs/react/reference/objects/EvmRpcProviderMethods.md) when fed with `evmProvidersSelector`
* [SolanaRpcProviderMethods](https://docs.dynamic.xyz/docs/react/reference/objects/SolanaRpcProviderMethods.md) when fed with `solanaProvidersSelector`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.