[v2.x] fix: type error by changing page props type to any#2520
Merged
pascalbaljet merged 3 commits intoinertiajs:masterfrom Aug 19, 2025
Merged
[v2.x] fix: type error by changing page props type to any#2520pascalbaljet merged 3 commits intoinertiajs:masterfrom
any#2520pascalbaljet merged 3 commits intoinertiajs:masterfrom
Conversation
Member
|
I don't like to change this across all adapters, as in React/Vue you can do type SveltePage = Omit<Page, 'props'> & {
props: Page['props'] & {
[key: string]: any
}
}
const { set, subscribe } = writable<SveltePage>() |
aff5f09 to
6b9ca8d
Compare
6b9ca8d to
9d94e72
Compare
Contributor
Author
|
@pascalbaljet Thanks for the review. I have changed it, let me know if anything else is needed. |
Member
|
Thanks! I've added a test so we know it keeps working in the future. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Type unknown is not assignable to type boolean.I get this error (and more for each line) when trying to use$page.props.username, because props are by default typed tounknown.Example
Example 1:
Example 2:
$props()in svelte and type it there or leave it, which works because$props()has type ofany). The following should be possible, but it is not currently, as I get type errors.{#if $page.props.flash.message} <div class="alert">{$page.props.flash.message}</div> {/if}