sshyam-gupta / react-router-prompt

A replacement component for the react-router 6 `Prompt`. Allows for more flexible dialogs.

Home Page:https://codesandbox.io/s/react-router-prompt-example-react-router-6-7-y9ug7z?file=/src/App.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Types not correctly exported in package.json

MDransfeld opened this issue · comments

This error occurs when trying to import in a Typescript project:

image

Seems to be fixed by added "types" to the export in the package.json:

image

Hey, @MDransfeld. Thank you so much for taking the time to point this out

Hi! Any plans to fix this issue? :)

I temporarily fixed this by adding the path to the tsconfig file like this:

{
  "compilerOptions": {
    "paths": {
      "react-router-prompt": ["node_modules/react-router-prompt/dist/index.d.ts"]
    }
  },
}

Thanks @sweethuman for the PR. I will take a look at it shortly.