Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 2592

Shim alternative for genType RescriptCore types

$
0
0

I just tested this out in project using the latest versions of rescript and rescript-react and I wasn’t able to reproduce.

Here’s the output I have from the button component you shared:

/* TypeScript file generated from btn.res by genType. */

/* eslint-disable */
/* tslint:disable */

import * as React from 'react';

import * as btnJS from './btn.js';

export type variant = 
    { NAME: "Button"; VAL: (_1:MouseEvent) => void }
  | { NAME: "A"; VAL: string };

export type Props = {
  readonly children: React.ReactNode; 
  readonly className?: string; 
  readonly color?: 
    "lime"
  | "smoke"; 
  readonly icon?: JSX.Element; 
  readonly isActive?: boolean; 
  readonly ref_?: React.Ref<unknown>; 
  readonly shape?: 
    "circle"
  | "oval"; 
  readonly size?: 
    "lg"
  | "md"
  | "sm"; 
  readonly variant: variant
};

export const make: React.ComponentType<{
  readonly children: React.ReactNode; 
  readonly className?: string; 
  readonly color?: 
    "lime"
  | "smoke"; 
  readonly icon?: JSX.Element; 
  readonly isActive?: boolean; 
  readonly ref_?: React.Ref<unknown>; 
  readonly shape?: 
    "circle"
  | "oval"; 
  readonly size?: 
    "lg"
  | "md"
  | "sm"; 
  readonly variant: variant
}> = btnJS.make as any;

Maybe try npx rescript clean?


Viewing all articles
Browse latest Browse all 2592

Trending Articles