Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: typos in v2 docs #357

Merged
merged 2 commits into from
Sep 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pages/blog/swr-v2.en-US.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ preload('/api/user', fetcher)

```jsx
mutate('/api/user', updateUserName(newName), {
optimisticData: user => ({ ...data, name: newName }),
optimisticData: user => ({ ...user, name: newName }),
rollbackOnError: true
});
```
Expand Down
2 changes: 1 addition & 1 deletion pages/blog/swr-v2.es-ES.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ preload('/api/user', fetcher)

```jsx
mutate('/api/user', updateUserName(newName), {
optimisticData: user => ({ ...data, name: newName }),
optimisticData: user => ({ ...user, name: newName }),
rollbackOnError: true
});
```
Expand Down
2 changes: 1 addition & 1 deletion pages/blog/swr-v2.ja.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ preload('/api/user', fetcher)

```jsx
mutate('/api/user', updateUserName(newName), {
optimisticData: user => ({ ...data, name: newName }),
optimisticData: user => ({ ...user, name: newName }),
rollbackOnError: true
});
```
Expand Down
2 changes: 1 addition & 1 deletion pages/blog/swr-v2.ko.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ preload('/api/user', fetcher)

```jsx
mutate('/api/user', updateUserName(newName), {
optimisticData: user => ({ ...data, name: newName }),
optimisticData: user => ({ ...user, name: newName }),
rollbackOnError: true
});
```
Expand Down
2 changes: 1 addition & 1 deletion pages/blog/swr-v2.pt-BR.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ preload('/api/user', fetcher)

```jsx
mutate('/api/user', updateUserName(newName), {
optimisticData: user => ({ ...data, name: newName }),
optimisticData: user => ({ ...user, name: newName }),
rollbackOnError: true
});
```
Expand Down
2 changes: 1 addition & 1 deletion pages/blog/swr-v2.ru.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ preload('/api/user', fetcher)

```jsx
mutate('/api/user', updateUserName(newName), {
optimisticData: user => ({ ...data, name: newName }),
optimisticData: user => ({ ...user, name: newName }),
rollbackOnError: true
});
```
Expand Down
2 changes: 1 addition & 1 deletion pages/blog/swr-v2.zh-CN.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ preload('/api/user', fetcher)

```jsx
mutate('/api/user', updateUserName(newName), {
optimisticData: user => ({ ...data, name: newName }),
optimisticData: user => ({ ...user, name: newName }),
rollbackOnError: true
});
```
Expand Down
4 changes: 2 additions & 2 deletions pages/docs/mutation.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function Profile () {
<button onClick={async () => {
const newName = data.name.toUpperCase()
mutate('/api/user', updateUserName(newName), {
optimisticData: user => ({ ...data, name: newName }),
optimisticData: user => ({ ...user, name: newName }),
rollbackOnError: true
});
}}>Uppercase my name!</button>
Expand Down Expand Up @@ -386,7 +386,7 @@ const fetcher = url => fetch(url).then(res => res.json())
const Page = () => {
const [show, setShow] = useState(false)
// data is undefined until trigger is called
const { data: user, trigger } = useSWR('/api/user', fetcher);
const { data: user, trigger } = useSWRMutation('/api/user', fetcher);

return (
<div>
Expand Down
4 changes: 2 additions & 2 deletions pages/docs/mutation.es-ES.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function Profile () {
<button onClick={async () => {
const newName = data.name.toUpperCase()
mutate('/api/user', updateUserName(newName), {
optimisticData: user => ({ ...data, name: newName }),
optimisticData: user => ({ ...user, name: newName }),
rollbackOnError: true
});
}}>Uppercase my name!</button>
Expand Down Expand Up @@ -384,7 +384,7 @@ const fetcher = url => fetch(url).then(res => res.json())
const Page = () => {
const [show, setShow] = useState(false)
// data is undefined until trigger is called
const { data: user, trigger } = useSWR('/api/user', fetcher);
const { data: user, trigger } = useSWRMutation('/api/user', fetcher);

return (
<div>
Expand Down
4 changes: 2 additions & 2 deletions pages/docs/mutation.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function Profile () {
<button onClick={async () => {
const newName = data.name.toUpperCase()
mutate('/api/user', updateUserName(newName), {
optimisticData: user => ({ ...data, name: newName }),
optimisticData: user => ({ ...user, name: newName }),
rollbackOnError: true
});
}}>Uppercase my name!</button>
Expand Down Expand Up @@ -388,7 +388,7 @@ const fetcher = url => fetch(url).then(res => res.json())
const Page = () => {
const [show, setShow] = useState(false)
// trigger が呼ばれるまで data は undefined です
const { data: user, trigger } = useSWR('/api/user', fetcher);
const { data: user, trigger } = useSWRMutation('/api/user', fetcher);

return (
<div>
Expand Down
4 changes: 2 additions & 2 deletions pages/docs/mutation.ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function Profile () {
<button onClick={async () => {
const newName = data.name.toUpperCase()
mutate('/api/user', updateUserName(newName), {
optimisticData: user => ({ ...data, name: newName }),
optimisticData: user => ({ ...user, name: newName }),
rollbackOnError: true
});
}}>Uppercase my name!</button>
Expand Down Expand Up @@ -385,7 +385,7 @@ const fetcher = url => fetch(url).then(res => res.json())
const Page = () => {
const [show, setShow] = useState(false)
// data is undefined until trigger is called
const { data: user, trigger } = useSWR('/api/user', fetcher);
const { data: user, trigger } = useSWRMutation('/api/user', fetcher);

return (
<div>
Expand Down
4 changes: 2 additions & 2 deletions pages/docs/mutation.pt-BR.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function Profile () {
<button onClick={async () => {
const newName = data.name.toUpperCase()
mutate('/api/user', updateUserName(newName), {
optimisticData: user => ({ ...data, name: newName }),
optimisticData: user => ({ ...user, name: newName }),
rollbackOnError: true
});
}}>Uppercase my name!</button>
Expand Down Expand Up @@ -385,7 +385,7 @@ const fetcher = url => fetch(url).then(res => res.json())
const Page = () => {
const [show, setShow] = useState(false)
// data is undefined until trigger is called
const { data: user, trigger } = useSWR('/api/user', fetcher);
const { data: user, trigger } = useSWRMutation('/api/user', fetcher);

return (
<div>
Expand Down
4 changes: 2 additions & 2 deletions pages/docs/mutation.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function Profile () {
<button onClick={async () => {
const newName = data.name.toUpperCase()
mutate('/api/user', updateUserName(newName), {
optimisticData: user => ({ ...data, name: newName }),
optimisticData: user => ({ ...user, name: newName }),
rollbackOnError: true
});
}}>Uppercase my name!</button>
Expand Down Expand Up @@ -381,7 +381,7 @@ const fetcher = url => fetch(url).then(res => res.json())
const Page = () => {
const [show, setShow] = useState(false)
// data is undefined until trigger is called
const { data: user, trigger } = useSWR('/api/user', fetcher);
const { data: user, trigger } = useSWRMutation('/api/user', fetcher);

return (
<div>
Expand Down
4 changes: 2 additions & 2 deletions pages/docs/mutation.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function Profile () {
<button onClick={async () => {
const newName = data.name.toUpperCase()
mutate('/api/user', updateUserName(newName), {
optimisticData: user => ({ ...data, name: newName }),
optimisticData: user => ({ ...user, name: newName }),
rollbackOnError: true
});
}}>Uppercase my name!</button>
Expand Down Expand Up @@ -381,7 +381,7 @@ const fetcher = url => fetch(url).then(res => res.json())
const Page = () => {
const [show, setShow] = useState(false)
// data is undefined until trigger is called
const { data: user, trigger } = useSWR('/api/user', fetcher);
const { data: user, trigger } = useSWRMutation('/api/user', fetcher);

return (
<div>
Expand Down