Skip to content

Commit

Permalink
[docs] fix typo in dapp-kit docs (createNetworkConfig vs. createNetwo…
Browse files Browse the repository at this point in the history
…rkConfigs) (#14330)

## Description 

I noticed a tiny typo while reading the dapp-kit docs, the actual
function is called `createNetworkConfig` and not `createNetworkConfigs`
😄

## Test Plan 
- Eyes

---
If your changes are not user-facing and not a breaking change, you can
skip the following section. Otherwise, please indicate what changed, and
then add to the Release Notes section as highlighted during the release
process.

### Type of Change (Check all that apply)

- [ ] protocol change
- [ ] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [ ] breaking change for validators or node operators (must upgrade
binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration

### Release notes
  • Loading branch information
williamrobertson13 authored Oct 18, 2023
1 parent 624af90 commit 34914bd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions sdk/dapp-kit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ providers. The props available on the providers are covered in more detail in th
pages.

```tsx
import { createNetworkConfigs, SuiClientProvider, WalletProvider } from '@mysten/dapp-kit';
import { createNetworkConfig, SuiClientProvider, WalletProvider } from '@mysten/dapp-kit';
import { type SuiClientOptions } from '@mysten/sui.js/client';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';

// Config options for the networks you want to connect to
const { networkConfig } = createNetworkConfigs({
const { networkConfig } = createNetworkConfig({
localnet: { url: getFullnodeUrl('localnet') },
mainnet: { url: getFullnodeUrl('mainnet') },
});
Expand Down
4 changes: 2 additions & 2 deletions sdk/docs/pages/dapp-kit/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ providers. The props available on the providers are covered in more detail in th
pages.

```tsx
import { createNetworkConfigs, SuiClientProvider, WalletProvider } from '@mysten/dapp-kit';
import { createNetworkConfig, SuiClientProvider, WalletProvider } from '@mysten/dapp-kit';
import { type SuiClientOptions } from '@mysten/sui.js/client';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';

// Config options for the networks you want to connect to
const { networkConfig } = createNetworkConfigs({
const { networkConfig } = createNetworkConfig({
localnet: { url: getFullnodeUrl('localnet') },
mainnet: { url: getFullnodeUrl('mainnet') },
});
Expand Down
18 changes: 9 additions & 9 deletions sdk/docs/pages/dapp-kit/sui-client-provider.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ It accepts a list of network configs, which will be used to create `SuiClient` i
currently active network.

```tsx
import { createNetworkConfigs, SuiClientProvider, WalletProvider } from '@mysten/dapp-kit';
import { createNetworkConfig, SuiClientProvider, WalletProvider } from '@mysten/dapp-kit';
import { type SuiClientOptions } from '@mysten/sui.js/client';

// Config options for the networks you want to connect to
Expand Down Expand Up @@ -45,12 +45,12 @@ function App() {
## Using the SuiClientProvider as a controlled component

```tsx
import { createNetworkConfigs, SuiClientProvider } from '@mysten/dapp-kit';
import { createNetworkConfig, SuiClientProvider } from '@mysten/dapp-kit';
import { type SuiClientOptions } from '@mysten/sui.js/client';
import { useState } from 'react';

// Config options for the networks you want to connect to
const { networkConfig } = createNetworkConfigs({
const { networkConfig } = createNetworkConfig({
localnet: { url: getFullnodeUrl('localnet') },
mainnet: { url: getFullnodeUrl('mainnet') },
});
Expand Down Expand Up @@ -144,25 +144,25 @@ function NetworkSelector() {
## Using network specific configuration

If your dApp runs on multiple networks, the IDs for packages, and potentially other configuration
will change depending on which network is being used. You can use `createNetworkConfigs` to create
will change depending on which network is being used. You can use `createNetworkConfig` to create
per-network config which can be accessed from your components.

the `createNetworkConfigs` function returns the provided config, along a few hooks you can use to
get access the variables defined in your config.
the `createNetworkConfig` function returns the provided config, along a few hooks you can use to get
access the variables defined in your config.

- `useNetworkConfig` returns the full network config object
- `useNetworkVariables` returns the full variables object from the network config
- `useNetworkVariable` returns a specific variable from the network config

```tsx
import { createNetworkConfigs, SuiClientProvider } from '@mysten/dapp-kit';
import { createNetworkConfig, SuiClientProvider } from '@mysten/dapp-kit';

import { createNetworkConfigs, SuiClientProvider, WalletProvider } from '@mysten/dapp-kit';
import { createNetworkConfig, SuiClientProvider, WalletProvider } from '@mysten/dapp-kit';
import { type SuiClientOptions } from '@mysten/sui.js/client';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';

// Config options for the networks you want to connect to
const { networkConfig, useNetworkVariable } = createNetworkConfigs({
const { networkConfig, useNetworkVariable } = createNetworkConfig({
localnet: {
url: getFullnodeUrl('localnet'),
variables: {
Expand Down

3 comments on commit 34914bd

@vercel
Copy link

@vercel vercel bot commented on 34914bd Oct 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 34914bd Oct 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

mysten-ui – ./apps/ui

mysten-ui-mysten-labs.vercel.app
mysten-ui-git-main-mysten-labs.vercel.app
mysten-ui.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 34914bd Oct 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.