devrnt / react-use-wizard

🧙 A React wizard (stepper) builder without the hassle, powered by hooks.

Home Page:https://devrnt.github.io/react-use-wizard/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Types not properly exported

MichielDeMey opened this issue · comments

Looks like not all types are properly exported in the package.json.

We're using https://github.com/import-js/eslint-import-resolver-typescript/ which will try to resolve types based on the exports definition in the package.json file.

However, the types such as WizardProps are defined in a separate types.d.ts file which is not exported and cannot be found.

I believe we can simply add "types": "./dist/types.d.ts" to the package.json file to resolve this?

One other option is to simply re-export the types in the index.ts file.

export * from './types';

That way we can easily import like import { WizardProps } from 'react-use-wizard';

Indeed, we should export the types (or all). Adding "types": "./dist/types.d.ts" won't help as far as I can see

I eventually got it to work by explicitly importing it as a type

import type { WizardProps } from 'react-use-wizard/dist/types';

However, re-exporting all types from the index like previously mentioned might be a better developer experience for some since you won't have to import from a dist directory.

Adding "types": "./dist/types.d.ts" indeed does not seem to work. 😅