Skip to content

Router.group prefix in type definition #105

@taylorshephard

Description

@taylorshephard

I'm having an issue:

According to docs here, the prefix option is optional for Router.group but required in the type definition

  • ostrio:flow-router-extra@3.9.0
  • METEOR@2.12
FlowRouter.group({
  name: 'fooGroup',
  triggersEnter: [],
});

error:

Parameter 'context' implicitly has an 'any' type, but a better type may be inferred from usage.ts(7044)
Argument of type '{ name: string; triggersEnter: ((context: any, redirect: any) => void)[]; }' is not assignable to parameter of type '{ [key: string]: any; name: string; prefix: string; }'.
  Property 'prefix' is missing in type '{ name: string; triggersEnter: ((context: any, redirect: any) => void)[]; }' but required in type '{ [key: string]: any; name: string; prefix: string; }'.ts(2345)
types.d.ts(59, 38): 'prefix' is declared here.

I have a suggestion:

make a change here

group: (options: { name: string; prefix?: string; [key: string]: any }) => any;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions