Skip to content

Documentation - $afterPageLoad (callback) requires a return value of boolean, but doc does not state so  #245

@Tommertom

Description

@Tommertom

When you enable typescript, the linter complains that afterPageLoad function cannot return void. So you have to add a return true (or false?) in the function.

Argument of type '(page: ClientNodeApi) => void' is not assignable to parameter of type '(page?: ClientNodeApi) => boolean'.
  Type 'void' is not assignable to type 'boolean'.ts(2345)

See helper documentation

Other typescript issue ( getDirection (path1, path2)):

$: lastRoute = $route.last

$route is of type never, so typescript won't eat this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions