The ViewTransitionOptions type is used to define a
viewTransition type.
interface ViewTransitionOptions {
types:
| Array<string>
| ((locationChangeInfo: {
fromLocation?: ParsedLocation
toLocation: ParsedLocation
pathChanged: boolean
hrefChanged: boolean
hashChanged: boolean
}) => Array<string> | false)
}
The ViewTransitionOptions type accepts an object with a single property:
- Type: Array<string> | ((locationChangeInfo: { fromLocation?: ParsedLocation toLocation: ParsedLocation pathChanged: boolean hrefChanged: boolean hashChanged: boolean }) => (Array<string> | false))
- Required
- Either one of:
- An array of strings that will be passed to the document.startViewTransition({update, types}) call
- A function that accepts locationChangeInfo object and returns either:
- An array of strings that will be passed to the document.startViewTransition({update, types}) call
- or false to skip the view transition