You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fe16a7d
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: src/content/reference/react/addTransitionType.md
+28-28Lines changed: 28 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ title: addTransitionType
4
4
5
5
<Intro>
6
6
7
-
`addTransitionType`lets you specify the cause of a transition.
7
+
`addTransitionType`を使うと、トランジションの原因を指定できます。
8
8
9
9
10
10
```js
@@ -20,30 +20,30 @@ startTransition(() => {
20
20
21
21
---
22
22
23
-
## Reference {/*reference*/}
23
+
## リファレンス {/*reference*/}
24
24
25
25
### `addTransitionType` {/*addtransitiontype*/}
26
26
27
-
#### Parameters {/*parameters*/}
27
+
#### 引数 {/*parameters*/}
28
28
29
-
-`type`: The type of transition to add. This can be any string.
29
+
-`type`: 追加するトランジションタイプ。任意の文字列を指定できます。
30
30
31
-
#### Returns {/*returns*/}
31
+
#### 返り値 {/*returns*/}
32
32
33
-
`addTransitionType`does not return anything.
33
+
`addTransitionType`は何も返しません。
34
34
35
-
#### Caveats {/*caveats*/}
35
+
#### 注意点 {/*caveats*/}
36
36
37
-
-If multiple transitions are combined, all Transition Types are collected. You can also add more than one type to a Transition.
38
-
-Transition Types are reset after each commit. This means a `<Suspense>`fallback will associate the types after a `startTransition`, but revealing the content does not.
import { startTransition, addTransitionType } from 'react';
@@ -61,22 +61,22 @@ function Submit({action) {
61
61
62
62
```
63
63
64
-
When you call <CodeStepstep={1}>addTransitionType</CodeStep> inside the scope of <CodeStepstep={2}>startTransition</CodeStep>, React will associate <CodeStepstep={3}>submit-click</CodeStep> as one of the causes for the Transition.
Currently, Transition Types can be used to customize different animations based on what caused the Transition. You have three different ways to choose from for how to use them:
When a [`ViewTransition`](/reference/react/ViewTransition)activates from a transition, React adds all the Transition Types as browser [view transition types](https://www.w3.org/TR/css-view-transitions-2/#active-view-transition-pseudo-examples)to the element.
If multiple types match, then they're joined together. If no types match then the special "default" entry is used instead. If any type has the value "none" then that wins and the ViewTransition is disabled (not assigned a name).
0 commit comments