fridays / next-routes

Universal dynamic routes for Next.js
MIT License
2.47k stars 230 forks source link

An error is occurred caused by type definition of next-routes #164

Closed uyeong closed 1 year ago

uyeong commented 6 years ago
2018-04-23 7 54 15

Type difinition is :

// next-routes.d.ts
export default class Routes implements Registry {
  getRequestHandler(app: Server, custom?: HTTPHandler): HTTPHandler;
  add(name: string, pattern?: string, page?: string): this;
  add(pattern: string, page: string): this;
  add(options: { name: string; pattern?: string; page?: string }): this;
  Link: ComponentType<LinkProps>;
  Router: Router;
}

But the implementation is :

// index.js
module.exports = function (opts) {
  return new Routes(opts);
};
gh0stonio commented 6 years ago

Do you know when the type definition will be updated? or of this is some workaround ?

fridays commented 6 years ago

@disintegrator do you know what we can do here?

disintegrator commented 6 years ago

@UYEONG, @gh0stonio, @fridays: Sorry for the late reply everyone. This comment in #163 (a related PR) contains a workaround: https://github.com/fridays/next-routes/pull/163#issuecomment-391673962

We are awaiting some feedback from @fridays on how to move forward on that PR