package jsoo-react

  1. Overview
  2. Docs

Source file core.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
[@@@js.dummy "!! This code has been generated by gen_js_api !!"]
[@@@ocaml.warning "-7-32-39"]
type element = Ojs.t
let rec element_of_js : Ojs.t -> element = fun (x2 : Ojs.t) -> x2
and element_to_js : element -> Ojs.t = fun (x1 : Ojs.t) -> x1
let null = Ojs.null
let (string : string -> element) =
  fun (x3 : string) -> element_of_js (Ojs.string_to_js x3)
let (int : int -> element) =
  fun (x4 : int) -> element_of_js (Ojs.int_to_js x4)
let (float : float -> element) =
  fun (x5 : float) -> element_of_js (Ojs.float_to_js x5)
type 'a option_undefined = 'a option
type 'a js_nullable = 'a Js_of_ocaml.Js.Opt.t
external equals : Ojs.t -> Ojs.t -> bool = "caml_js_equals"
let undefined = Ojs.variable "undefined"
let option_undefined_of_js f x =
  if equals x undefined then None else Some (f x)
let option_undefined_to_js f = function | Some x -> f x | None -> undefined
external js_nullable_of_ojs : Ojs.t -> 'value js_nullable = "%identity"
external js_nullable_to_js : 'value js_nullable -> Ojs.t = "%identity"
let js_nullable_of_js _f x = js_nullable_of_ojs x
let js_nullable_to_js _f x = js_nullable_to_js x
type ('props, 'return) componentLike = 'props -> 'return
type 'props component = ('props, element) componentLike
let component_to_js cb = cb
let component_of_js js = js
type ('input, 'output) callback = 'input -> 'output
let callback_to_js _ cb = cb
let callback_of_js _ js = js
let (create_element_internal :
  Imports.react -> 'a component -> 'a -> element) =
  fun (x9 : Imports.react) ->
    fun (x6 : 'a component) ->
      fun (x8 : 'a) ->
        element_of_js
          (Ojs.call (Imports.react_to_js x9) "createElement"
             [|(component_to_js Obj.magic x6);(Obj.magic x8)|])
let create_element component props =
  create_element_internal Imports.react component props
let (create_element_variadic_internal :
  Imports.react -> 'props component -> 'props -> element list -> element) =
  fun (x16 : Imports.react) ->
    fun (x10 : 'props component) ->
      fun (x11 : 'props) ->
        fun (x12 : element list) ->
          element_of_js
            (let x17 = Imports.react_to_js x16 in
             Ojs.call (Ojs.get_prop_ascii x17 "createElement") "apply"
               [|x17;((let x13 =
                         Ojs.new_obj (Ojs.get_prop_ascii Ojs.global "Array")
                           [||] in
                       ignore
                         (Ojs.call x13 "push"
                            [|(component_to_js Obj.magic x10)|]);
                       ignore (Ojs.call x13 "push" [|(Obj.magic x11)|]);
                       List.iter
                         (fun (x14 : element) ->
                            ignore
                              (Ojs.call x13 "push" [|(element_to_js x14)|]))
                         x12;
                       x13))|])
let create_element_variadic component props elements =
  create_element_variadic_internal Imports.react component props elements
let (clone_element_internal : Imports.react -> element -> 'a -> element) =
  fun (x20 : Imports.react) ->
    fun (x18 : element) ->
      fun (x19 : 'a) ->
        element_of_js
          (Ojs.call (Imports.react_to_js x20) "cloneElement"
             [|(element_to_js x18);(Obj.magic x19)|])
let clone_element element props =
  clone_element_internal Imports.react element props
let (_use_effect :
  Imports.react -> (unit -> (unit -> unit) option_undefined) -> unit) =
  fun (x23 : Imports.react) ->
    fun (x21 : unit -> (unit -> unit) option_undefined) ->
      ignore
        (Ojs.call (Imports.react_to_js x23) "useEffect"
           [|(Ojs.fun_to_js 1
                (fun _ ->
                   option_undefined_to_js
                     (fun (x22 : unit -> unit) ->
                        Ojs.fun_to_js 1 (fun _ -> x22 ())) (x21 ())))|])
let (_use_layout_effect :
  Imports.react -> (unit -> (unit -> unit) option_undefined) -> unit) =
  fun (x26 : Imports.react) ->
    fun (x24 : unit -> (unit -> unit) option_undefined) ->
      ignore
        (Ojs.call (Imports.react_to_js x26) "useLayoutEffect"
           [|(Ojs.fun_to_js 1
                (fun _ ->
                   option_undefined_to_js
                     (fun (x25 : unit -> unit) ->
                        Ojs.fun_to_js 1 (fun _ -> x25 ())) (x24 ())))|])
let use_effect_always ?(before_render= false)  f =
  (if before_render then _use_layout_effect else _use_effect) Imports.react f
let (_use_effect :
  Imports.react ->
    (unit -> (unit -> unit) option_undefined) -> 'a array -> unit)
  =
  fun (x31 : Imports.react) ->
    fun (x27 : unit -> (unit -> unit) option_undefined) ->
      fun (x29 : 'a array) ->
        ignore
          (Ojs.call (Imports.react_to_js x31) "useEffect"
             [|(Ojs.fun_to_js 1
                  (fun _ ->
                     option_undefined_to_js
                       (fun (x28 : unit -> unit) ->
                          Ojs.fun_to_js 1 (fun _ -> x28 ())) (x27 ())));(
               Ojs.array_to_js Obj.magic x29)|])
let (_use_layout_effect :
  Imports.react ->
    (unit -> (unit -> unit) option_undefined) -> 'a array -> unit)
  =
  fun (x36 : Imports.react) ->
    fun (x32 : unit -> (unit -> unit) option_undefined) ->
      fun (x34 : 'a array) ->
        ignore
          (Ojs.call (Imports.react_to_js x36) "useLayoutEffect"
             [|(Ojs.fun_to_js 1
                  (fun _ ->
                     option_undefined_to_js
                       (fun (x33 : unit -> unit) ->
                          Ojs.fun_to_js 1 (fun _ -> x33 ())) (x32 ())));(
               Ojs.array_to_js Obj.magic x34)|])
let use_effect_once ?(before_render= false)  f =
  (if before_render then _use_layout_effect else _use_effect) Imports.react f
    [||]
let (_use_effect :
  Imports.react ->
    (unit -> (unit -> unit) option_undefined) -> 'a array -> unit)
  =
  fun (x41 : Imports.react) ->
    fun (x37 : unit -> (unit -> unit) option_undefined) ->
      fun (x39 : 'a array) ->
        ignore
          (Ojs.call (Imports.react_to_js x41) "useEffect"
             [|(Ojs.fun_to_js 1
                  (fun _ ->
                     option_undefined_to_js
                       (fun (x38 : unit -> unit) ->
                          Ojs.fun_to_js 1 (fun _ -> x38 ())) (x37 ())));(
               Ojs.array_to_js Obj.magic x39)|])
let (_use_layout_effect :
  Imports.react ->
    (unit -> (unit -> unit) option_undefined) -> 'a array -> unit)
  =
  fun (x46 : Imports.react) ->
    fun (x42 : unit -> (unit -> unit) option_undefined) ->
      fun (x44 : 'a array) ->
        ignore
          (Ojs.call (Imports.react_to_js x46) "useLayoutEffect"
             [|(Ojs.fun_to_js 1
                  (fun _ ->
                     option_undefined_to_js
                       (fun (x43 : unit -> unit) ->
                          Ojs.fun_to_js 1 (fun _ -> x43 ())) (x42 ())));(
               Ojs.array_to_js Obj.magic x44)|])
let use_effect1 ?(before_render= false)  f value =
  (if before_render then _use_layout_effect else _use_effect) Imports.react f
    [|value|]
let (_use_effect2 :
  Imports.react ->
    (unit -> (unit -> unit) option_undefined) -> ('a * 'b) -> unit)
  =
  fun (x53 : Imports.react) ->
    fun (x47 : unit -> (unit -> unit) option_undefined) ->
      fun (x49 : ('a * 'b)) ->
        ignore
          (Ojs.call (Imports.react_to_js x53) "useEffect"
             [|(Ojs.fun_to_js 1
                  (fun _ ->
                     option_undefined_to_js
                       (fun (x48 : unit -> unit) ->
                          Ojs.fun_to_js 1 (fun _ -> x48 ())) (x47 ())));((
               let (x50, x51) = x49 in
               let x52 = Ojs.array_make 2 in
               Ojs.array_set x52 0 (Obj.magic x50);
               Ojs.array_set x52 1 (Obj.magic x51);
               x52))|])
let (_use_layout_effect2 :
  Imports.react ->
    (unit -> (unit -> unit) option_undefined) -> ('a * 'b) -> unit)
  =
  fun (x60 : Imports.react) ->
    fun (x54 : unit -> (unit -> unit) option_undefined) ->
      fun (x56 : ('a * 'b)) ->
        ignore
          (Ojs.call (Imports.react_to_js x60) "useLayoutEffect"
             [|(Ojs.fun_to_js 1
                  (fun _ ->
                     option_undefined_to_js
                       (fun (x55 : unit -> unit) ->
                          Ojs.fun_to_js 1 (fun _ -> x55 ())) (x54 ())));((
               let (x57, x58) = x56 in
               let x59 = Ojs.array_make 2 in
               Ojs.array_set x59 0 (Obj.magic x57);
               Ojs.array_set x59 1 (Obj.magic x58);
               x59))|])
let use_effect2 ?(before_render= false)  f values =
  (if before_render then _use_layout_effect2 else _use_effect2) Imports.react
    f values
let (_use_effect3 :
  Imports.react ->
    (unit -> (unit -> unit) option_undefined) -> ('a * 'b * 'c) -> unit)
  =
  fun (x68 : Imports.react) ->
    fun (x61 : unit -> (unit -> unit) option_undefined) ->
      fun (x63 : ('a * 'b * 'c)) ->
        ignore
          (Ojs.call (Imports.react_to_js x68) "useEffect"
             [|(Ojs.fun_to_js 1
                  (fun _ ->
                     option_undefined_to_js
                       (fun (x62 : unit -> unit) ->
                          Ojs.fun_to_js 1 (fun _ -> x62 ())) (x61 ())));((
               let (x64, x65, x66) = x63 in
               let x67 = Ojs.array_make 3 in
               Ojs.array_set x67 0 (Obj.magic x64);
               Ojs.array_set x67 1 (Obj.magic x65);
               Ojs.array_set x67 2 (Obj.magic x66);
               x67))|])
let (_use_layout_effect3 :
  Imports.react ->
    (unit -> (unit -> unit) option_undefined) -> ('a * 'b * 'c) -> unit)
  =
  fun (x76 : Imports.react) ->
    fun (x69 : unit -> (unit -> unit) option_undefined) ->
      fun (x71 : ('a * 'b * 'c)) ->
        ignore
          (Ojs.call (Imports.react_to_js x76) "useLayoutEffect"
             [|(Ojs.fun_to_js 1
                  (fun _ ->
                     option_undefined_to_js
                       (fun (x70 : unit -> unit) ->
                          Ojs.fun_to_js 1 (fun _ -> x70 ())) (x69 ())));((
               let (x72, x73, x74) = x71 in
               let x75 = Ojs.array_make 3 in
               Ojs.array_set x75 0 (Obj.magic x72);
               Ojs.array_set x75 1 (Obj.magic x73);
               Ojs.array_set x75 2 (Obj.magic x74);
               x75))|])
let use_effect3 ?(before_render= false)  f values =
  (if before_render then _use_layout_effect3 else _use_effect3) Imports.react
    f values
let (_use_effect4 :
  Imports.react ->
    (unit -> (unit -> unit) option_undefined) -> ('a * 'b * 'c * 'd) -> unit)
  =
  fun (x85 : Imports.react) ->
    fun (x77 : unit -> (unit -> unit) option_undefined) ->
      fun (x79 : ('a * 'b * 'c * 'd)) ->
        ignore
          (Ojs.call (Imports.react_to_js x85) "useEffect"
             [|(Ojs.fun_to_js 1
                  (fun _ ->
                     option_undefined_to_js
                       (fun (x78 : unit -> unit) ->
                          Ojs.fun_to_js 1 (fun _ -> x78 ())) (x77 ())));((
               let (x80, x81, x82, x83) = x79 in
               let x84 = Ojs.array_make 4 in
               Ojs.array_set x84 0 (Obj.magic x80);
               Ojs.array_set x84 1 (Obj.magic x81);
               Ojs.array_set x84 2 (Obj.magic x82);
               Ojs.array_set x84 3 (Obj.magic x83);
               x84))|])
let (_use_layout_effect4 :
  Imports.react ->
    (unit -> (unit -> unit) option_undefined) -> ('a * 'b * 'c * 'd) -> unit)
  =
  fun (x94 : Imports.react) ->
    fun (x86 : unit -> (unit -> unit) option_undefined) ->
      fun (x88 : ('a * 'b * 'c * 'd)) ->
        ignore
          (Ojs.call (Imports.react_to_js x94) "useLayoutEffect"
             [|(Ojs.fun_to_js 1
                  (fun _ ->
                     option_undefined_to_js
                       (fun (x87 : unit -> unit) ->
                          Ojs.fun_to_js 1 (fun _ -> x87 ())) (x86 ())));((
               let (x89, x90, x91, x92) = x88 in
               let x93 = Ojs.array_make 4 in
               Ojs.array_set x93 0 (Obj.magic x89);
               Ojs.array_set x93 1 (Obj.magic x90);
               Ojs.array_set x93 2 (Obj.magic x91);
               Ojs.array_set x93 3 (Obj.magic x92);
               x93))|])
let use_effect4 ?(before_render= false)  f values =
  (if before_render then _use_layout_effect4 else _use_effect4) Imports.react
    f values
let (_use_effect5 :
  Imports.react ->
    (unit -> (unit -> unit) option_undefined) ->
      ('a * 'b * 'c * 'd * 'e) -> unit)
  =
  fun (x104 : Imports.react) ->
    fun (x95 : unit -> (unit -> unit) option_undefined) ->
      fun (x97 : ('a * 'b * 'c * 'd * 'e)) ->
        ignore
          (Ojs.call (Imports.react_to_js x104) "useEffect"
             [|(Ojs.fun_to_js 1
                  (fun _ ->
                     option_undefined_to_js
                       (fun (x96 : unit -> unit) ->
                          Ojs.fun_to_js 1 (fun _ -> x96 ())) (x95 ())));((
               let (x98, x99, x100, x101, x102) = x97 in
               let x103 = Ojs.array_make 5 in
               Ojs.array_set x103 0 (Obj.magic x98);
               Ojs.array_set x103 1 (Obj.magic x99);
               Ojs.array_set x103 2 (Obj.magic x100);
               Ojs.array_set x103 3 (Obj.magic x101);
               Ojs.array_set x103 4 (Obj.magic x102);
               x103))|])
let (_use_layout_effect5 :
  Imports.react ->
    (unit -> (unit -> unit) option_undefined) ->
      ('a * 'b * 'c * 'd * 'e) -> unit)
  =
  fun (x114 : Imports.react) ->
    fun (x105 : unit -> (unit -> unit) option_undefined) ->
      fun (x107 : ('a * 'b * 'c * 'd * 'e)) ->
        ignore
          (Ojs.call (Imports.react_to_js x114) "useLayoutEffect"
             [|(Ojs.fun_to_js 1
                  (fun _ ->
                     option_undefined_to_js
                       (fun (x106 : unit -> unit) ->
                          Ojs.fun_to_js 1 (fun _ -> x106 ())) (x105 ())));((
               let (x108, x109, x110, x111, x112) = x107 in
               let x113 = Ojs.array_make 5 in
               Ojs.array_set x113 0 (Obj.magic x108);
               Ojs.array_set x113 1 (Obj.magic x109);
               Ojs.array_set x113 2 (Obj.magic x110);
               Ojs.array_set x113 3 (Obj.magic x111);
               Ojs.array_set x113 4 (Obj.magic x112);
               x113))|])
let use_effect5 ?(before_render= false)  f values =
  (if before_render then _use_layout_effect5 else _use_effect5) Imports.react
    f values
let (_use_effect6 :
  Imports.react ->
    (unit -> (unit -> unit) option_undefined) ->
      ('a * 'b * 'c * 'd * 'e * 'f) -> unit)
  =
  fun (x125 : Imports.react) ->
    fun (x115 : unit -> (unit -> unit) option_undefined) ->
      fun (x117 : ('a * 'b * 'c * 'd * 'e * 'f)) ->
        ignore
          (Ojs.call (Imports.react_to_js x125) "useEffect"
             [|(Ojs.fun_to_js 1
                  (fun _ ->
                     option_undefined_to_js
                       (fun (x116 : unit -> unit) ->
                          Ojs.fun_to_js 1 (fun _ -> x116 ())) (x115 ())));((
               let (x118, x119, x120, x121, x122, x123) = x117 in
               let x124 = Ojs.array_make 6 in
               Ojs.array_set x124 0 (Obj.magic x118);
               Ojs.array_set x124 1 (Obj.magic x119);
               Ojs.array_set x124 2 (Obj.magic x120);
               Ojs.array_set x124 3 (Obj.magic x121);
               Ojs.array_set x124 4 (Obj.magic x122);
               Ojs.array_set x124 5 (Obj.magic x123);
               x124))|])
let (_use_layout_effect6 :
  Imports.react ->
    (unit -> (unit -> unit) option_undefined) ->
      ('a * 'b * 'c * 'd * 'e * 'f) -> unit)
  =
  fun (x136 : Imports.react) ->
    fun (x126 : unit -> (unit -> unit) option_undefined) ->
      fun (x128 : ('a * 'b * 'c * 'd * 'e * 'f)) ->
        ignore
          (Ojs.call (Imports.react_to_js x136) "useLayoutEffect"
             [|(Ojs.fun_to_js 1
                  (fun _ ->
                     option_undefined_to_js
                       (fun (x127 : unit -> unit) ->
                          Ojs.fun_to_js 1 (fun _ -> x127 ())) (x126 ())));((
               let (x129, x130, x131, x132, x133, x134) = x128 in
               let x135 = Ojs.array_make 6 in
               Ojs.array_set x135 0 (Obj.magic x129);
               Ojs.array_set x135 1 (Obj.magic x130);
               Ojs.array_set x135 2 (Obj.magic x131);
               Ojs.array_set x135 3 (Obj.magic x132);
               Ojs.array_set x135 4 (Obj.magic x133);
               Ojs.array_set x135 5 (Obj.magic x134);
               x135))|])
let use_effect6 ?(before_render= false)  f values =
  (if before_render then _use_layout_effect6 else _use_effect6) Imports.react
    f values
let (_use_effect7 :
  Imports.react ->
    (unit -> (unit -> unit) option_undefined) ->
      ('a * 'b * 'c * 'd * 'e * 'f * 'g) -> unit)
  =
  fun (x148 : Imports.react) ->
    fun (x137 : unit -> (unit -> unit) option_undefined) ->
      fun (x139 : ('a * 'b * 'c * 'd * 'e * 'f * 'g)) ->
        ignore
          (Ojs.call (Imports.react_to_js x148) "useEffect"
             [|(Ojs.fun_to_js 1
                  (fun _ ->
                     option_undefined_to_js
                       (fun (x138 : unit -> unit) ->
                          Ojs.fun_to_js 1 (fun _ -> x138 ())) (x137 ())));((
               let (x140, x141, x142, x143, x144, x145, x146) = x139 in
               let x147 = Ojs.array_make 7 in
               Ojs.array_set x147 0 (Obj.magic x140);
               Ojs.array_set x147 1 (Obj.magic x141);
               Ojs.array_set x147 2 (Obj.magic x142);
               Ojs.array_set x147 3 (Obj.magic x143);
               Ojs.array_set x147 4 (Obj.magic x144);
               Ojs.array_set x147 5 (Obj.magic x145);
               Ojs.array_set x147 6 (Obj.magic x146);
               x147))|])
let (_use_layout_effect7 :
  Imports.react ->
    (unit -> (unit -> unit) option_undefined) ->
      ('a * 'b * 'c * 'd * 'e * 'f * 'g) -> unit)
  =
  fun (x160 : Imports.react) ->
    fun (x149 : unit -> (unit -> unit) option_undefined) ->
      fun (x151 : ('a * 'b * 'c * 'd * 'e * 'f * 'g)) ->
        ignore
          (Ojs.call (Imports.react_to_js x160) "useLayoutEffect"
             [|(Ojs.fun_to_js 1
                  (fun _ ->
                     option_undefined_to_js
                       (fun (x150 : unit -> unit) ->
                          Ojs.fun_to_js 1 (fun _ -> x150 ())) (x149 ())));((
               let (x152, x153, x154, x155, x156, x157, x158) = x151 in
               let x159 = Ojs.array_make 7 in
               Ojs.array_set x159 0 (Obj.magic x152);
               Ojs.array_set x159 1 (Obj.magic x153);
               Ojs.array_set x159 2 (Obj.magic x154);
               Ojs.array_set x159 3 (Obj.magic x155);
               Ojs.array_set x159 4 (Obj.magic x156);
               Ojs.array_set x159 5 (Obj.magic x157);
               Ojs.array_set x159 6 (Obj.magic x158);
               x159))|])
let use_effect7 ?(before_render= false)  f values =
  (if before_render then _use_layout_effect7 else _use_effect7) Imports.react
    f values
let (use_callback1_internal :
  Imports.react ->
    ('input, 'output) callback -> 'a array -> ('input, 'output) callback)
  =
  fun (x166 : Imports.react) ->
    fun (x161 : ('input, 'output) callback) ->
      fun (x164 : 'a array) ->
        callback_of_js Obj.magic Obj.magic
          (Ojs.call (Imports.react_to_js x166) "useCallback"
             [|(callback_to_js Obj.magic Obj.magic x161);(Ojs.array_to_js
                                                            Obj.magic x164)|])
let use_callback1 callback watchlist =
  use_callback1_internal Imports.react callback [|watchlist|]
let (use_callback2_internal :
  Imports.react ->
    ('input, 'output) callback -> ('a * 'b) -> ('input, 'output) callback)
  =
  fun (x176 : Imports.react) ->
    fun (x169 : ('input, 'output) callback) ->
      fun (x172 : ('a * 'b)) ->
        callback_of_js Obj.magic Obj.magic
          (Ojs.call (Imports.react_to_js x176) "useCallback"
             [|(callback_to_js Obj.magic Obj.magic x169);((let (x173, x174) =
                                                             x172 in
                                                           let x175 =
                                                             Ojs.array_make 2 in
                                                           Ojs.array_set x175
                                                             0
                                                             (Obj.magic x173);
                                                           Ojs.array_set x175
                                                             1
                                                             (Obj.magic x174);
                                                           x175))|])
let use_callback2 callback watchlist =
  use_callback2_internal Imports.react callback watchlist
let (use_callback3_internal :
  Imports.react ->
    ('input, 'output) callback ->
      ('a * 'b * 'c) -> ('input, 'output) callback)
  =
  fun (x187 : Imports.react) ->
    fun (x179 : ('input, 'output) callback) ->
      fun (x182 : ('a * 'b * 'c)) ->
        callback_of_js Obj.magic Obj.magic
          (Ojs.call (Imports.react_to_js x187) "useCallback"
             [|(callback_to_js Obj.magic Obj.magic x179);((let (x183, x184,
                                                                x185)
                                                             = x182 in
                                                           let x186 =
                                                             Ojs.array_make 3 in
                                                           Ojs.array_set x186
                                                             0
                                                             (Obj.magic x183);
                                                           Ojs.array_set x186
                                                             1
                                                             (Obj.magic x184);
                                                           Ojs.array_set x186
                                                             2
                                                             (Obj.magic x185);
                                                           x186))|])
let use_callback3 callback watchlist =
  use_callback3_internal Imports.react callback watchlist
let (use_callback4_internal :
  Imports.react ->
    ('input, 'output) callback ->
      ('a * 'b * 'c * 'd) -> ('input, 'output) callback)
  =
  fun (x199 : Imports.react) ->
    fun (x190 : ('input, 'output) callback) ->
      fun (x193 : ('a * 'b * 'c * 'd)) ->
        callback_of_js Obj.magic Obj.magic
          (Ojs.call (Imports.react_to_js x199) "useCallback"
             [|(callback_to_js Obj.magic Obj.magic x190);((let (x194, x195,
                                                                x196, x197)
                                                             = x193 in
                                                           let x198 =
                                                             Ojs.array_make 4 in
                                                           Ojs.array_set x198
                                                             0
                                                             (Obj.magic x194);
                                                           Ojs.array_set x198
                                                             1
                                                             (Obj.magic x195);
                                                           Ojs.array_set x198
                                                             2
                                                             (Obj.magic x196);
                                                           Ojs.array_set x198
                                                             3
                                                             (Obj.magic x197);
                                                           x198))|])
let use_callback4 callback watchlist =
  use_callback4_internal Imports.react callback watchlist
let (use_callback5_internal :
  Imports.react ->
    ('input, 'output) callback ->
      ('a * 'b * 'c * 'd * 'e) -> ('input, 'output) callback)
  =
  fun (x212 : Imports.react) ->
    fun (x202 : ('input, 'output) callback) ->
      fun (x205 : ('a * 'b * 'c * 'd * 'e)) ->
        callback_of_js Obj.magic Obj.magic
          (Ojs.call (Imports.react_to_js x212) "useCallback"
             [|(callback_to_js Obj.magic Obj.magic x202);((let (x206, x207,
                                                                x208, x209,
                                                                x210)
                                                             = x205 in
                                                           let x211 =
                                                             Ojs.array_make 5 in
                                                           Ojs.array_set x211
                                                             0
                                                             (Obj.magic x206);
                                                           Ojs.array_set x211
                                                             1
                                                             (Obj.magic x207);
                                                           Ojs.array_set x211
                                                             2
                                                             (Obj.magic x208);
                                                           Ojs.array_set x211
                                                             3
                                                             (Obj.magic x209);
                                                           Ojs.array_set x211
                                                             4
                                                             (Obj.magic x210);
                                                           x211))|])
let use_callback5 callback watchlist =
  use_callback5_internal Imports.react callback watchlist
let (use_callback6_internal :
  Imports.react ->
    ('input, 'output) callback ->
      ('a * 'b * 'c * 'd * 'e * 'f) -> ('input, 'output) callback)
  =
  fun (x226 : Imports.react) ->
    fun (x215 : ('input, 'output) callback) ->
      fun (x218 : ('a * 'b * 'c * 'd * 'e * 'f)) ->
        callback_of_js Obj.magic Obj.magic
          (Ojs.call (Imports.react_to_js x226) "useCallback"
             [|(callback_to_js Obj.magic Obj.magic x215);((let (x219, x220,
                                                                x221, x222,
                                                                x223, x224)
                                                             = x218 in
                                                           let x225 =
                                                             Ojs.array_make 6 in
                                                           Ojs.array_set x225
                                                             0
                                                             (Obj.magic x219);
                                                           Ojs.array_set x225
                                                             1
                                                             (Obj.magic x220);
                                                           Ojs.array_set x225
                                                             2
                                                             (Obj.magic x221);
                                                           Ojs.array_set x225
                                                             3
                                                             (Obj.magic x222);
                                                           Ojs.array_set x225
                                                             4
                                                             (Obj.magic x223);
                                                           Ojs.array_set x225
                                                             5
                                                             (Obj.magic x224);
                                                           x225))|])
let use_callback6 callback watchlist =
  use_callback6_internal Imports.react callback watchlist
let (use_callback7_internal :
  Imports.react ->
    ('input, 'output) callback ->
      ('a * 'b * 'c * 'd * 'e * 'f * 'g) -> ('input, 'output) callback)
  =
  fun (x241 : Imports.react) ->
    fun (x229 : ('input, 'output) callback) ->
      fun (x232 : ('a * 'b * 'c * 'd * 'e * 'f * 'g)) ->
        callback_of_js Obj.magic Obj.magic
          (Ojs.call (Imports.react_to_js x241) "useCallback"
             [|(callback_to_js Obj.magic Obj.magic x229);((let (x233, x234,
                                                                x235, x236,
                                                                x237, x238,
                                                                x239)
                                                             = x232 in
                                                           let x240 =
                                                             Ojs.array_make 7 in
                                                           Ojs.array_set x240
                                                             0
                                                             (Obj.magic x233);
                                                           Ojs.array_set x240
                                                             1
                                                             (Obj.magic x234);
                                                           Ojs.array_set x240
                                                             2
                                                             (Obj.magic x235);
                                                           Ojs.array_set x240
                                                             3
                                                             (Obj.magic x236);
                                                           Ojs.array_set x240
                                                             4
                                                             (Obj.magic x237);
                                                           Ojs.array_set x240
                                                             5
                                                             (Obj.magic x238);
                                                           Ojs.array_set x240
                                                             6
                                                             (Obj.magic x239);
                                                           x240))|])
let use_callback7 callback watchlist =
  use_callback7_internal Imports.react callback watchlist
let (use_memo1_internal :
  Imports.react -> (unit -> 'value) -> 'a array -> 'value) =
  fun (x247 : Imports.react) ->
    fun (x244 : unit -> 'value) ->
      fun (x245 : 'a array) ->
        Obj.magic
          (Ojs.call (Imports.react_to_js x247) "useMemo"
             [|(Ojs.fun_to_js 1 (fun _ -> Obj.magic (x244 ())));(Ojs.array_to_js
                                                                   Obj.magic
                                                                   x245)|])
let use_memo1 callback watchlist =
  use_memo1_internal Imports.react callback [|watchlist|]
let (use_memo2_internal :
  Imports.react -> (unit -> 'value) -> ('a * 'b) -> 'value) =
  fun (x253 : Imports.react) ->
    fun (x248 : unit -> 'value) ->
      fun (x249 : ('a * 'b)) ->
        Obj.magic
          (Ojs.call (Imports.react_to_js x253) "useMemo"
             [|(Ojs.fun_to_js 1 (fun _ -> Obj.magic (x248 ())));((let 
                                                                    (x250,
                                                                    x251) =
                                                                    x249 in
                                                                  let x252 =
                                                                    Ojs.array_make
                                                                    2 in
                                                                  Ojs.array_set
                                                                    x252 0
                                                                    (
                                                                    Obj.magic
                                                                    x250);
                                                                  Ojs.array_set
                                                                    x252 1
                                                                    (
                                                                    Obj.magic
                                                                    x251);
                                                                  x252))|])
let use_memo2 callback watchlist =
  use_memo2_internal Imports.react callback watchlist
let (use_memo3_internal :
  Imports.react -> (unit -> 'value) -> ('a * 'b * 'c) -> 'value) =
  fun (x260 : Imports.react) ->
    fun (x254 : unit -> 'value) ->
      fun (x255 : ('a * 'b * 'c)) ->
        Obj.magic
          (Ojs.call (Imports.react_to_js x260) "useMemo"
             [|(Ojs.fun_to_js 1 (fun _ -> Obj.magic (x254 ())));((let 
                                                                    (x256,
                                                                    x257,
                                                                    x258) =
                                                                    x255 in
                                                                  let x259 =
                                                                    Ojs.array_make
                                                                    3 in
                                                                  Ojs.array_set
                                                                    x259 0
                                                                    (
                                                                    Obj.magic
                                                                    x256);
                                                                  Ojs.array_set
                                                                    x259 1
                                                                    (
                                                                    Obj.magic
                                                                    x257);
                                                                  Ojs.array_set
                                                                    x259 2
                                                                    (
                                                                    Obj.magic
                                                                    x258);
                                                                  x259))|])
let use_memo3 callback watchlist =
  use_memo3_internal Imports.react callback watchlist
let (use_memo4_internal :
  Imports.react -> (unit -> 'value) -> ('a * 'b * 'c * 'd) -> 'value) =
  fun (x268 : Imports.react) ->
    fun (x261 : unit -> 'value) ->
      fun (x262 : ('a * 'b * 'c * 'd)) ->
        Obj.magic
          (Ojs.call (Imports.react_to_js x268) "useMemo"
             [|(Ojs.fun_to_js 1 (fun _ -> Obj.magic (x261 ())));((let 
                                                                    (x263,
                                                                    x264,
                                                                    x265,
                                                                    x266) =
                                                                    x262 in
                                                                  let x267 =
                                                                    Ojs.array_make
                                                                    4 in
                                                                  Ojs.array_set
                                                                    x267 0
                                                                    (
                                                                    Obj.magic
                                                                    x263);
                                                                  Ojs.array_set
                                                                    x267 1
                                                                    (
                                                                    Obj.magic
                                                                    x264);
                                                                  Ojs.array_set
                                                                    x267 2
                                                                    (
                                                                    Obj.magic
                                                                    x265);
                                                                  Ojs.array_set
                                                                    x267 3
                                                                    (
                                                                    Obj.magic
                                                                    x266);
                                                                  x267))|])
let use_memo4 callback watchlist =
  use_memo4_internal Imports.react callback watchlist
let (use_memo5_internal :
  Imports.react -> (unit -> 'value) -> ('a * 'b * 'c * 'd * 'e) -> 'value) =
  fun (x277 : Imports.react) ->
    fun (x269 : unit -> 'value) ->
      fun (x270 : ('a * 'b * 'c * 'd * 'e)) ->
        Obj.magic
          (Ojs.call (Imports.react_to_js x277) "useMemo"
             [|(Ojs.fun_to_js 1 (fun _ -> Obj.magic (x269 ())));((let 
                                                                    (x271,
                                                                    x272,
                                                                    x273,
                                                                    x274,
                                                                    x275) =
                                                                    x270 in
                                                                  let x276 =
                                                                    Ojs.array_make
                                                                    5 in
                                                                  Ojs.array_set
                                                                    x276 0
                                                                    (
                                                                    Obj.magic
                                                                    x271);
                                                                  Ojs.array_set
                                                                    x276 1
                                                                    (
                                                                    Obj.magic
                                                                    x272);
                                                                  Ojs.array_set
                                                                    x276 2
                                                                    (
                                                                    Obj.magic
                                                                    x273);
                                                                  Ojs.array_set
                                                                    x276 3
                                                                    (
                                                                    Obj.magic
                                                                    x274);
                                                                  Ojs.array_set
                                                                    x276 4
                                                                    (
                                                                    Obj.magic
                                                                    x275);
                                                                  x276))|])
let use_memo5 callback watchlist =
  use_memo5_internal Imports.react callback watchlist
let (use_memo6_internal :
  Imports.react ->
    (unit -> 'value) -> ('a * 'b * 'c * 'd * 'e * 'f) -> 'value)
  =
  fun (x287 : Imports.react) ->
    fun (x278 : unit -> 'value) ->
      fun (x279 : ('a * 'b * 'c * 'd * 'e * 'f)) ->
        Obj.magic
          (Ojs.call (Imports.react_to_js x287) "useMemo"
             [|(Ojs.fun_to_js 1 (fun _ -> Obj.magic (x278 ())));((let 
                                                                    (x280,
                                                                    x281,
                                                                    x282,
                                                                    x283,
                                                                    x284,
                                                                    x285) =
                                                                    x279 in
                                                                  let x286 =
                                                                    Ojs.array_make
                                                                    6 in
                                                                  Ojs.array_set
                                                                    x286 0
                                                                    (
                                                                    Obj.magic
                                                                    x280);
                                                                  Ojs.array_set
                                                                    x286 1
                                                                    (
                                                                    Obj.magic
                                                                    x281);
                                                                  Ojs.array_set
                                                                    x286 2
                                                                    (
                                                                    Obj.magic
                                                                    x282);
                                                                  Ojs.array_set
                                                                    x286 3
                                                                    (
                                                                    Obj.magic
                                                                    x283);
                                                                  Ojs.array_set
                                                                    x286 4
                                                                    (
                                                                    Obj.magic
                                                                    x284);
                                                                  Ojs.array_set
                                                                    x286 5
                                                                    (
                                                                    Obj.magic
                                                                    x285);
                                                                  x286))|])
let use_memo6 callback watchlist =
  use_memo6_internal Imports.react callback watchlist
let (use_memo7_internal :
  Imports.react ->
    (unit -> 'value) -> ('a * 'b * 'c * 'd * 'e * 'f * 'g) -> 'value)
  =
  fun (x298 : Imports.react) ->
    fun (x288 : unit -> 'value) ->
      fun (x289 : ('a * 'b * 'c * 'd * 'e * 'f * 'g)) ->
        Obj.magic
          (Ojs.call (Imports.react_to_js x298) "useMemo"
             [|(Ojs.fun_to_js 1 (fun _ -> Obj.magic (x288 ())));((let 
                                                                    (x290,
                                                                    x291,
                                                                    x292,
                                                                    x293,
                                                                    x294,
                                                                    x295,
                                                                    x296) =
                                                                    x289 in
                                                                  let x297 =
                                                                    Ojs.array_make
                                                                    7 in
                                                                  Ojs.array_set
                                                                    x297 0
                                                                    (
                                                                    Obj.magic
                                                                    x290);
                                                                  Ojs.array_set
                                                                    x297 1
                                                                    (
                                                                    Obj.magic
                                                                    x291);
                                                                  Ojs.array_set
                                                                    x297 2
                                                                    (
                                                                    Obj.magic
                                                                    x292);
                                                                  Ojs.array_set
                                                                    x297 3
                                                                    (
                                                                    Obj.magic
                                                                    x293);
                                                                  Ojs.array_set
                                                                    x297 4
                                                                    (
                                                                    Obj.magic
                                                                    x294);
                                                                  Ojs.array_set
                                                                    x297 5
                                                                    (
                                                                    Obj.magic
                                                                    x295);
                                                                  Ojs.array_set
                                                                    x297 6
                                                                    (
                                                                    Obj.magic
                                                                    x296);
                                                                  x297))|])
let use_memo7 callback watchlist =
  use_memo7_internal Imports.react callback watchlist
let (use_state_internal :
  Imports.react ->
    (unit -> 'state) -> ('state * (('state -> 'state) -> unit)))
  =
  fun (react : Imports.react) ->
    fun (init : unit -> 'state) ->
      let result =
        Ojs.call (Imports.react_to_js react) "useState"
          [|(Ojs.fun_to_js 1 (fun _ -> Obj.magic (init ())))|] in
      ((Obj.magic (Ojs.array_get result 0)),
        (Obj.magic (Ojs.array_get result 1)))
let use_state initial = use_state_internal Imports.react initial
let use_reducer_internal : type state action.
  Imports.react ->
    init:(unit -> state) ->
      (state -> action -> state) -> (state * (action -> unit))
  =
  fun react ->
    fun ~init ->
      fun reducer ->
        let any_to_js : _ -> Ojs.t = Obj.magic in
        let js_to_any : Ojs.t -> _ = Obj.magic in
        let result =
          Ojs.call (Imports.react_to_js react) "useReducer"
            [|(Ojs.fun_to_js 2
                 (fun state ->
                    fun action ->
                      any_to_js
                        (reducer (js_to_any state : state)
                           (js_to_any action : action))));Ojs.null;(Ojs.fun_to_js
                                                                    1
                                                                    (fun _ ->
                                                                    any_to_js
                                                                    (init ())))|] in
        let open Js_of_ocaml in
          ((Js.Unsafe.get result 0), (Js.Unsafe.get result 1))
let use_reducer ~init  reducer =
  use_reducer_internal Imports.react ~init reducer
module Ref =
  struct
    type 'value t = Ojs.t
    let rec t_of_js : 'value . (Ojs.t -> 'value) -> Ojs.t -> 'value t =
      fun (type __value) ->
        fun (__value_of_js : Ojs.t -> __value) -> fun (x300 : Ojs.t) -> x300
    and t_to_js : 'value . ('value -> Ojs.t) -> 'value t -> Ojs.t =
      fun (type __value) ->
        fun (__value_to_js : __value -> Ojs.t) -> fun (x299 : Ojs.t) -> x299
    let (make_internal : Imports.react -> unit -> 'a js_nullable t) =
      fun (x301 : Imports.react) ->
        fun () ->
          t_of_js (fun (x302 : Ojs.t) -> js_nullable_of_js Obj.magic x302)
            (Ojs.call (Imports.react_to_js x301) "createRef" [||])
    let make () = make_internal Imports.react ()
    let (current : 'value t -> 'value) =
      fun (x304 : 'value t) ->
        Obj.magic (Ojs.get_prop_ascii (t_to_js Obj.magic x304) "current")
    let (set_current : 'value t -> 'value -> unit) =
      fun (x306 : 'value t) ->
        fun (x307 : 'value) ->
          Ojs.set_prop_ascii (t_to_js Obj.magic x306) "current"
            (Obj.magic x307)
  end
let (use_ref_internal : Imports.react -> 'value -> 'value Ref.t) =
  fun (x310 : Imports.react) ->
    fun (x309 : 'value) ->
      Ref.t_of_js Obj.magic
        (Ojs.call (Imports.react_to_js x310) "useRef" [|(Obj.magic x309)|])
let use_ref value = use_ref_internal Imports.react value
module Context =
  struct
    type 'props t = Ojs.t
    let rec t_of_js : 'props . (Ojs.t -> 'props) -> Ojs.t -> 'props t =
      fun (type __props) ->
        fun (__props_of_js : Ojs.t -> __props) -> fun (x313 : Ojs.t) -> x313
    and t_to_js : 'props . ('props -> Ojs.t) -> 'props t -> Ojs.t =
      fun (type __props) ->
        fun (__props_to_js : __props -> Ojs.t) -> fun (x312 : Ojs.t) -> x312
    let (make_internal : Imports.react -> 'a -> 'a t) =
      fun (x315 : Imports.react) ->
        fun (x314 : 'a) ->
          t_of_js Obj.magic
            (Ojs.call (Imports.react_to_js x315) "createContext"
               [|(Obj.magic x314)|])
    let make value = make_internal Imports.react value
    let (provider : 'props t -> 'props component) =
      fun (x317 : 'props t) ->
        component_of_js Obj.magic
          (Ojs.get_prop_ascii (t_to_js Obj.magic x317) "Provider")
    module Provider =
      struct
        let make_props value =
          let open Js_of_ocaml.Js.Unsafe in obj [|("value", (inject value))|]
        let make context ~value  ~children  () =
          create_element_variadic (provider context) (make_props value)
            children
      end
  end
let (use_context_internal : Imports.react -> 'a Context.t -> 'a) =
  fun (x322 : Imports.react) ->
    fun (x320 : 'a Context.t) ->
      Obj.magic
        (Ojs.call (Imports.react_to_js x322) "useContext"
           [|(Context.t_to_js Obj.magic x320)|])
let use_context ctx = use_context_internal Imports.react ctx
module Children =
  struct
    let (children_internal' : Imports.react -> Ojs.t) =
      fun (x323 : Imports.react) ->
        Ojs.get_prop_ascii (Imports.react_to_js x323) "Children"
    let children_internal = children_internal' Imports.react
    let (map_internal :
      Ojs.t -> element list -> (element -> element) -> element) =
      fun (x328 : Ojs.t) ->
        fun (x324 : element list) ->
          fun (x326 : element -> element) ->
            element_of_js
              (Ojs.call x328 "map"
                 [|(Ojs.list_to_js element_to_js x324);(Ojs.fun_to_js 1
                                                          (fun (x327 : Ojs.t)
                                                             ->
                                                             element_to_js
                                                               (x326
                                                                  (element_of_js
                                                                    x327))))|])
    let map element mapper = map_internal children_internal element mapper
    let (mapi_internal :
      Ojs.t -> element list -> (element -> int -> element) -> element) =
      fun (x334 : Ojs.t) ->
        fun (x329 : element list) ->
          fun (x331 : element -> int -> element) ->
            element_of_js
              (Ojs.call x334 "map"
                 [|(Ojs.list_to_js element_to_js x329);(Ojs.fun_to_js 2
                                                          (fun (x332 : Ojs.t)
                                                             ->
                                                             fun
                                                               (x333 : Ojs.t)
                                                               ->
                                                               element_to_js
                                                                 (x331
                                                                    (
                                                                    element_of_js
                                                                    x332)
                                                                    (
                                                                    Ojs.int_of_js
                                                                    x333))))|])
    let mapi element mapper = mapi_internal children_internal element mapper
    let (iter_internal : Ojs.t -> element list -> (element -> unit) -> unit)
      =
      fun (x339 : Ojs.t) ->
        fun (x335 : element list) ->
          fun (x337 : element -> unit) ->
            ignore
              (Ojs.call x339 "forEach"
                 [|(Ojs.list_to_js element_to_js x335);(Ojs.fun_to_js 1
                                                          (fun (x338 : Ojs.t)
                                                             ->
                                                             x337
                                                               (element_of_js
                                                                  x338)))|])
    let iter element iterator =
      iter_internal children_internal element iterator
    let (iteri_internal :
      Ojs.t -> element list -> (element -> int -> unit) -> unit) =
      fun (x345 : Ojs.t) ->
        fun (x340 : element list) ->
          fun (x342 : element -> int -> unit) ->
            ignore
              (Ojs.call x345 "forEach"
                 [|(Ojs.list_to_js element_to_js x340);(Ojs.fun_to_js 2
                                                          (fun (x343 : Ojs.t)
                                                             ->
                                                             fun
                                                               (x344 : Ojs.t)
                                                               ->
                                                               x342
                                                                 (element_of_js
                                                                    x343)
                                                                 (Ojs.int_of_js
                                                                    x344)))|])
    let iteri element iterator =
      iteri_internal children_internal element iterator
    let (count_internal : Ojs.t -> element list -> int) =
      fun (x348 : Ojs.t) ->
        fun (x346 : element list) ->
          Ojs.int_of_js
            (Ojs.call x348 "count" [|(Ojs.list_to_js element_to_js x346)|])
    let count element = count_internal children_internal element
    let (only_internal : Ojs.t -> element list -> element) =
      fun (x351 : Ojs.t) ->
        fun (x349 : element list) ->
          element_of_js
            (Ojs.call x351 "only" [|(Ojs.list_to_js element_to_js x349)|])
    let only element = only_internal children_internal element
    let (to_array_internal : Ojs.t -> element list -> element array) =
      fun (x354 : Ojs.t) ->
        fun (x352 : element list) ->
          Ojs.array_of_js element_of_js
            (Ojs.call x354 "toArray" [|(Ojs.list_to_js element_to_js x352)|])
    let to_array element = to_array_internal children_internal element
  end
module Fragment =
  struct
    external to_component :
      Ojs.t ->
        < children: element Js_of_ocaml.Js.readonly_prop   > 
          Js_of_ocaml.Js.t component = "%identity"
    let (fragment_internal' : Imports.react -> Ojs.t) =
      fun (x356 : Imports.react) ->
        Ojs.get_prop_ascii (Imports.react_to_js x356) "Fragment"
    let fragment_internal = fragment_internal' Imports.react
    let make_props ?key  () =
      match key with
      | Some k ->
          let open Js_of_ocaml.Js.Unsafe in obj [|("key", (inject k))|]
      | None -> let open Js_of_ocaml.Js.Unsafe in obj [||]
    let make ~children  ?key  () =
      create_element_variadic (to_component fragment_internal)
        (make_props ?key ()) children
  end
module StrictMode =
  struct
    external to_component :
      Ojs.t ->
        < children: element Js_of_ocaml.Js.readonly_prop   > 
          Js_of_ocaml.Js.t component = "%identity"
    let (strict_mode_internal' : Imports.react -> Ojs.t) =
      fun (x357 : Imports.react) ->
        Ojs.get_prop_ascii (Imports.react_to_js x357) "StrictMode"
    let strict_mode_internal = strict_mode_internal' Imports.react
    let make_props ?key  () =
      match key with
      | Some k ->
          let open Js_of_ocaml.Js.Unsafe in obj [|("key", (inject k))|]
      | None -> let open Js_of_ocaml.Js.Unsafe in obj [||]
    let make ~children  ?key  () =
      create_element_variadic (to_component strict_mode_internal)
        (make_props ?key ()) children
  end
let (memo_internal :
  Imports.react ->
    'props component ->
      ('props -> 'props -> bool) option_undefined -> 'props component)
  =
  fun (x364 : Imports.react) ->
    fun (x358 : 'props component) ->
      fun (x360 : ('props -> 'props -> bool) option_undefined) ->
        component_of_js Obj.magic
          (Ojs.call (Imports.react_to_js x364) "memo"
             [|(component_to_js Obj.magic x358);(option_undefined_to_js
                                                   (fun
                                                      (x361 :
                                                        'props ->
                                                          'props -> bool)
                                                      ->
                                                      Ojs.fun_to_js 2
                                                        (fun (x362 : Ojs.t)
                                                           ->
                                                           fun (x363 : Ojs.t)
                                                             ->
                                                             Ojs.bool_to_js
                                                               (x361
                                                                  (Obj.magic
                                                                    x362)
                                                                  (Obj.magic
                                                                    x363))))
                                                   x360)|])
let memo ?compare  component = memo_internal Imports.react component compare
let (set_display_name : 'props component -> string -> unit) =
  fun (x366 : 'props component) ->
    fun (x367 : string) ->
      Ojs.set_prop_ascii (component_to_js Obj.magic x366) "displayName"
        (Ojs.string_to_js x367)
OCaml

Innovation. Community. Security.