Skip to content

SharedProps returning error when used in usePage hook #46

Open
@josevelaz

Description

@josevelaz

Package version

1.2.2

Describe the bug

When augmenting the SharedProps interface like shown in the documentation, an error is raised by the usePage<SharedProps>() hook.

 tsserver: Type 'SharedProps' does not satisfy the constraint 'PageProps'.
   Index signature for type 'string' is missing in type 'SharedProps'. [2344]

Passing any value into the module augmentation causes it to break

declare module '@adonisjs/inertia/types' {
  export interface SharedProps extends InferSharedProps<typeof inertiaConfig> {
    props2: string
  }
}

If prop2: string is removed then the error above goes away

image

CleanShot 2024-11-19 at 10 52 14@2x

Reproduction repo

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions