Skip to content

Commit 063e548

Browse files
authored
Merge pull request #17 from lumihq/codedmart/codegen-onchange
Fix onChange codegen type
2 parents af0bcdf + 8dc50f8 commit 063e548

File tree

2 files changed

+126
-123
lines changed

2 files changed

+126
-123
lines changed

Diff for: codegen/index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const types = {
1919
"multiple": "Boolean",
2020
"muted": "Boolean",
2121
"noValidate": "Boolean",
22+
"onChange": "EventHandler",
2223
"open": "Boolean",
2324
"playsInline": "Boolean",
2425
"readOnly": "Boolean",
@@ -46,7 +47,7 @@ props.elements.html
4647
const noChildren = voids.includes(e);
4748
const symbol = reserved.includes(e) ? `${e}'` : e;
4849
return `
49-
type Props_${e} = ${printRecord(
50+
type Props_${e} =${printRecord(
5051
(noChildren ? [] : ["children"]).concat(props[e] || []).sort()
5152
)}
5253
@@ -57,9 +58,10 @@ props.elements.html
5758
-> JSX
5859
${symbol} = createElement (unsafeCreateDOMComponent "${e}")${
5960
noChildren ? "" : `
60-
61+
6162
${e}_ :: Array JSX -> JSX
6263
${e}_ children = ${symbol} { children }`
6364
}
6465
`;
6566
}).forEach((x) => console.log(x.replace(/^\n\ {4}/, "").replace(/\n\ {4}/g, "\n")))
67+

0 commit comments

Comments
 (0)