timolins / react-hot-toast

Smoking Hot React Notifications 🔥
https://react-hot-toast.com
MIT License
9.79k stars 331 forks source link

Unsafe call of an `any` typed value when exporting 'toast' #123

Closed Offpics closed 3 years ago

Offpics commented 3 years ago

I want to export toast from a file with predefined options. It works, however I encounter an eslint error coming from @typescript-eslint.

Minimal code generating the error:

// toast/index.tsx
export { toast } from 'react-hot-toast';
// index.tsx
import { toast } from './toast';
toast('Hello World'); // ERROR (eslint: @typescript-eslint): Unsafe call of `any` typed value.

I'm new to typescript and I'm not sure how to fix it. Is it a bug on my side or in react-hot-toast implementation?

Offpics commented 3 years ago

Please delete this issue