diff --git a/pages/docs/manual/v12.0.0/array-and-list.mdx b/pages/docs/manual/v12.0.0/array-and-list.mdx index c70eed178..88ca3cffa 100644 --- a/pages/docs/manual/v12.0.0/array-and-list.mdx +++ b/pages/docs/manual/v12.0.0/array-and-list.mdx @@ -207,13 +207,20 @@ var anotherList = { let message = switch myList { | list{} => "This list is empty" + | list{first, second, ...rest} => "The list two items and a potenial remainder of items" | list{a, ...rest} => "The head of the list is the string " ++ Int.toString(a) } ``` ```js -var message = myList - ? "The head of the list is the string " + (1).toString() - : "This list is empty"; +let message = myList !== 0 ? ( + ({ + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + }) !== 0 ? "The list two items and a potenial remainder of items" : "The head of the list is the string " + (1).toString() + ) : "This list is empty"; ``` diff --git a/pages/docs/react/latest/router.mdx b/pages/docs/react/latest/router.mdx index 5d95287aa..923efe5ad 100644 --- a/pages/docs/react/latest/router.mdx +++ b/pages/docs/react/latest/router.mdx @@ -76,7 +76,7 @@ let make = () => { let url = RescriptReactRouter.useUrl() switch url.path { - | list{"user", id} => + | list{"user", id, ..._} => | list{} => | _ => } @@ -90,28 +90,28 @@ import * as Home from "./Home.res.js"; import * as NotFound from "./NotFound.res.js"; function App(Props) { - var url = RescriptReactRouter.useUrl(undefined, undefined); - var match = url.path; - if (!match) { - return React.createElement(Home.make, {}); + let url = RescriptReactRouter.useUrl(undefined, undefined); + let match = url.path; + if (match === 0) { + return JsxRuntime.jsx(Home, {}); } - if (match.hd === "user") { - var match$1 = match.tl; - if (match$1 && !match$1.tl) { - return React.createElement(User.make, { - id: match$1.hd - }); - } - + if (match.hd !== "user") { + return JsxRuntime.jsx(NotFound, {}); + } + let match$1 = match.tl; + if (match$1 !== 0 && match$1.tl === 0) { + return JsxRuntime.jsx(User, { + id: match$1.hd + }); + } else { + return JsxRuntime.jsx(NotFound, {}); } - return React.createElement(NotFound.make, {}); } var make = App; export { - make , - + make, } ```