File tree Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ let default = () => {
38
38
<body >
39
39
<Navigation isOverlayOpen setOverlayOpen />
40
40
<Outlet />
41
+ <ScrollRestoration />
41
42
<Scripts />
42
43
</body >
43
44
</html >
Original file line number Diff line number Diff line change @@ -26,6 +26,11 @@ module Outlet = {
26
26
external make : unit => React .element = "Outlet"
27
27
}
28
28
29
+ module ScrollRestoration = {
30
+ @module ("react-router" ) @react.component
31
+ external make : unit => React .element = "ScrollRestoration"
32
+ }
33
+
29
34
module Meta = {
30
35
@module ("react-router" ) @react.component
31
36
external make : unit => React .element = "Meta"
@@ -48,6 +53,7 @@ module Link = {
48
53
~className : string = ?,
49
54
~target : string = ?,
50
55
~to : Path .t ,
56
+ ~preventScrollReset : bool = ?,
51
57
) => React .element = "Link"
52
58
53
59
module Path = {
@@ -61,6 +67,7 @@ module Link = {
61
67
~target : string = ?,
62
68
~id : string = ?,
63
69
~to : to ,
70
+ ~preventScrollReset : bool = ?,
64
71
) => React .element = "Link"
65
72
}
66
73
@@ -72,6 +79,7 @@ module Link = {
72
79
~className : string = ?,
73
80
~target : string = ?,
74
81
~to : string ,
82
+ ~preventScrollReset : bool = ?,
75
83
) => React .element = "Link"
76
84
}
77
85
}
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ module Toc = {
32
32
onClick = {_evt => scrollToAnchor (href )}
33
33
to = href
34
34
className = "font-normal block text-14 text-gray-40 leading-tight hover:text-gray-80"
35
+ preventScrollReset = true
35
36
>
36
37
{//links, nested
37
38
React .string (header )}
You can’t perform that action at this time.
0 commit comments