Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.x] Fix React TS errors #381

Merged
merged 2 commits into from
Apr 24, 2024
Merged

[2.x] Fix React TS errors #381

merged 2 commits into from
Apr 24, 2024

Conversation

jessarcher
Copy link
Member

This PR fixes the following TypeScript error in the React SSR build:

 resources/js/ssr.tsx(18,17): error TS2769: No overload matches this call.
  Overload 1 of 4, '(name: string & {}, params?: RouteParams<string & {}> | undefined, absolute?: boolean | undefined, config?: Config | undefined): string', gave the following error.
    Argument of type 'ParameterValue | RouteParams<string & {}> | undefined' is not assignable to parameter of type 'RouteParams<string & {}> | undefined'.
      Type 'string' is not assignable to type 'RouteParams<string & {}> | undefined'.
  Overload 2 of 4, '(name: string & {}, params?: ParameterValue | undefined, absolute?: boolean | undefined, config?: Config | undefined): string', gave the following error.
    Argument of type 'ParameterValue | RouteParams<string & {}> | undefined' is not assignable to parameter of type 'ParameterValue | undefined'.
      Type 'GenericRouteParamsObject' is not assignable to type 'ParameterValue | undefined'.
        Type 'GenericRouteParamsObject' is not assignable to type 'DefaultRoutable'.
          Property 'id' is missing in type 'GenericRouteParamsObject' but required in type '{ id: RawParameterValue; }'.
  Overload 3 of 4, '(name: undefined, params: undefined, absolute?: boolean | undefined, config?: Config | undefined): Router', gave the following error.
    Argument of type 'string & {}' is not assignable to parameter of type 'undefined'.

It also fixes a JSX/TSX syntax issue in the default welcome page that caused errors when running the SSR server.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@driesvints driesvints merged commit 3ee0211 into 2.x Apr 24, 2024
19 checks passed
@driesvints
Copy link
Member

Thanks @jessarcher!

@driesvints driesvints deleted the fix-react-ts-error branch April 24, 2024 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants