Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit 0e664cc

Browse files
committed
add test for optimization of jsx mode
1 parent f3b0573 commit 0e664cc

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
@@jsxConfig({version: 4, mode: "automatic"})
2+
3+
module User = {
4+
type t = {firstName: string, lastName: string}
5+
6+
let format = user => "Dr." ++ user.lastName
7+
type props<'doctor> = {
8+
doctor: 'doctor,
9+
}
10+
11+
@react.component
12+
let make = ({doctor, _}: props<'doctor>) => {
13+
ReactDOM.jsx("h1", {id: "h1", children: {React.string(format(doctor))}})
14+
}
15+
let make = {
16+
let \"OptimizeAutomaticMode$User" = (props: props<_>) => make(props)
17+
18+
\"OptimizeAutomaticMode$User"
19+
}
20+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@@jsxConfig({version: 4, mode: "automatic"})
2+
3+
module User = {
4+
type t = {firstName: string, lastName: string}
5+
6+
let format = user => "Dr." ++ user.lastName
7+
8+
@react.component
9+
let make = (~doctor) => {
10+
<h1 id="h1"> {React.string(format(doctor))} </h1>
11+
}
12+
}

0 commit comments

Comments
 (0)