Skip to content

Commit

Permalink
docs: fix links url (#691)
Browse files Browse the repository at this point in the history
* docs: fix links url

* docs: make all links relative paths
  • Loading branch information
devagja authored Mar 15, 2023
1 parent 792c9f8 commit 7fe26c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/api/basic/proxy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ authState.user.name = 'Nina'

#### Promises in proxies

See [`async`](/docs/advanced/async) for more details.
See [`async`](../../guides/async) for more details.

```jsx
import { proxy } from 'valtio'
Expand Down
8 changes: 4 additions & 4 deletions docs/introduction/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ npm i valtio

#### 1. proxy

Let's learn Valtio by coding a simple to-do app in React and Typescript. We'll start by creating some state using [`proxy`](/docs/basic/proxy).
Let's learn Valtio by coding a simple to-do app in React and Typescript. We'll start by creating some state using [`proxy`](../api/basic/proxy).

```ts
import { proxy, useSnapshot } from 'valtio'
Expand All @@ -44,7 +44,7 @@ export const store = proxy<{ filter: Filter; todos: Todo[] }>({

#### 2. useSnapshot

To access the data in this store, we'll use [`useSnapshot`](/docs/basic/useSnapshot). The Todos component will rerender when the "todos" or "filter" properties are updated. Any other data we add to the proxy will be ignored.
To access the data in this store, we'll use [`useSnapshot`](../api/basic/useSnapshot). The Todos component will rerender when the "todos" or "filter" properties are updated. Any other data we add to the proxy will be ignored.

```tsx
const Todos = () => {
Expand Down Expand Up @@ -122,7 +122,7 @@ type Todo = {
}
```
Among other changes, we will add a Countdown component to display the ticking time for each todo. We are using an advanced technique of passing a nested proxy object to [`useSnapshot`](/docs/basic/useSnapshot). Alternatively, make this a dumb component by passing the todo's "timeLeft" as a prop.
Among other changes, we will add a Countdown component to display the ticking time for each todo. We are using an advanced technique of passing a nested proxy object to [`useSnapshot`](../api/basic/useSnapshot). Alternatively, make this a dumb component by passing the todo's "timeLeft" as a prop.
```tsx
import { useSnapshot } from 'valtio'
Expand Down Expand Up @@ -198,7 +198,7 @@ Please see the rest of the changes in the demo below.

#### Subscribe in module scope

Being able to mutate state outside of components is a huge benefit. We can also [`subscribe`](/docs/basic/subscribe) to state changes in module scope. We will leave it to you to try this out. You might, for instance, persist your todos to local storage as in [this example](https://github.com/pmndrs/valtio/wiki/How-to-persist-states#persist-with-localstorage).
Being able to mutate state outside of components is a huge benefit. We can also [`subscribe`](../api/advanced/subscribe) to state changes in module scope. We will leave it to you to try this out. You might, for instance, persist your todos to local storage as in [this example](https://github.com/pmndrs/valtio/wiki/How-to-persist-states#persist-with-localstorage).

## Codesandbox demo

Expand Down

1 comment on commit 7fe26c2

@vercel
Copy link

@vercel vercel bot commented on 7fe26c2 Mar 15, 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:

valtio – ./

valtio-git-main-pmndrs.vercel.app
valtio-pmndrs.vercel.app
valtio.vercel.app
valtio.pmnd.rs

Please sign in to comment.