Skip to content

UseRedirectProps doesn't match useRedirect() props #158

Description

@neoncube2

useRedirect() is defined like this:

export function useRedirect(
  predicateUrl: string | null,
  targetUrl: string,
  {
    query,
    replace = true,
    merge = true,
    state,
  }: { query?: QueryParam; replace?: boolean; merge?: boolean; state?: unknown } = {},
)

There's also a UseRedirectProps export, which looks like this:

export interface UseRedirectProps {
  predicateUrl: string
  targetUrl: string
  queryParams?: QueryParam | URLSearchParams
  replace?: boolean
  state?: unknown
}

I don't use TypeScript, but it looks like the shape of UseRedirectProps doesn't match the shape of useRedirect()'s actual props. (query, replace, merge, and state are expected to be passed in a separate object)

Just FYI.

I probably don't have time to fix this, but I think it'd be an easy win for someone who is familiar with TypeScript :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions