alva icon indicating copy to clipboard operation
alva copied to clipboard

Incorrect import of Ant design library

Open kianris opened this issue 5 years ago • 2 comments

Importing antd almost works out of the box, once compiled Alva will import all the components but the properties are not correct. I can't get Alva running from source but it seems like it's matching props from incorrect *.d.ts, even from node_modules. Antd is written in TypeScript but with a module layout that may be confusing the analyzer, since each module has it's own directory and index.js.

Is there a way I can tweak the module format to fix the props issue?

This is in v0.9.1. I couldn't find a way to import local libraries in the master version.

To get Antd ready for import:

git clone https://github.com/ant-design/ant-design.git
cd ant-design
npm run compile

Definition from row.d.ts:

export interface RowProps extends React.HTMLAttributes<HTMLDivElement> {
    gutter?: number | Partial<Record<Breakpoint, number>>;
    type?: 'flex';
    align?: (typeof RowAligns)[number];
    justify?: (typeof RowJustify)[number];
    prefixCls?: string;
}

Properties in Alva:

prefixCls
defaultChecked
defaultValue
suppressContentEditableWarning
suppressHydrationWarning
spellCheck
...

Only prefixCls from the definition is there.

kianris avatar Mar 05 '19 23:03 kianris

Hey thanks for reporting. Could you provide a bit more details, e.g. screenshots of properties you wouldn't expect?

marionebl avatar Mar 07 '19 10:03 marionebl

Added details, this is for v0.9.1.

kianris avatar Mar 08 '19 00:03 kianris