Skip to content

Commit 182177a

Browse files
committed
Add example of JSX V4 with genType.
No special treatment so far, just a normal function as if it were written by hand.
1 parent 8333e3f commit 182177a

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

Diff for: jscomp/gentype_tests/typescript-react-example/src/JSXV4.bs.js

+13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/* TypeScript file generated from JSXV4.res by genType. */
2+
/* eslint-disable import/first */
3+
4+
5+
// @ts-ignore: Implicit any on import
6+
import * as JSXV4BS__Es6Import from './JSXV4.bs';
7+
const JSXV4BS: any = JSXV4BS__Es6Import;
8+
9+
// tslint:disable-next-line:interface-over-type-literal
10+
export type props<x,y> = {
11+
readonly key?: string;
12+
readonly x: x;
13+
readonly y: y
14+
};
15+
16+
export const make: (_1:props<string,string>) => JSX.Element = JSXV4BS.make;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@@jsxConfig({version: 4})
2+
3+
@genType @react.component
4+
let make = (~x, ~y) => React.string(x ++ y)

0 commit comments

Comments
 (0)