0

I'm trying to copy what was done in this link here while making a slight modification. Instead of using daterangepicker, I'm using react-list-nav. However, I still am unable to get my project to "notice" any of the listnav functions, such as $('#demoOne').listnav();

My copy of typings.d.ts is below

interface JQuery {
   "react-list-nav"(options?: any, callback?: Function) : any;
}

In my index.ts I am importing as follows:

import * as rln from "react-list-nav"
// this errors
// $('#demoOne').listnav() 

What am I doing wrong?

1 Answers1

0

You'll want this in your typings.d.ts

declare interface JQuery {
  listnav(options?: any, callback?: any): any
}
Paul Huynh
  • 2,462
  • 1
  • 11
  • 11
  • I've done this. However, I am still getting the error that it can't find the declaration file for module "react-list-nav" when I try to import. – horusoftheblackflame Oct 09 '20 at 13:33
  • Include `declare module "react-list-nav";` in your `typings.d.ts` to resolve your import error. – Paul Huynh Oct 09 '20 at 23:10
  • Ok, there is no longer an import error so thank you for that. however, I am now getting an issue in my console saying ".listnav is not a function". Do you know what I'm missing? – horusoftheblackflame Oct 12 '20 at 20:09