Repository navigation
fix(gatsby): pass serverData to Head - #37500
Merged
Merged
Conversation
pieh
commented
Jan 19, 2023
Comment on lines
-159
to
+163
| export type HeadProps<DataType = object, PageContextType = object> = { | ||
| export type HeadProps< | ||
| DataType = object, | ||
| PageContextType = object, | ||
| ServerDataType = object | ||
| > = { |
Contributor
Author
There was a problem hiding this comment.
Setup copied from PageProps (tho not sure if I should also add Location part, we should decide on that, because generics are position arguments, so trying to add it later would be a problem):
gatsby/packages/gatsby/index.d.ts
Lines 87 to 154 in fe65c29
Contributor
There was a problem hiding this comment.
With Head the location will only ever be pathname so there won't be a need for LocationState generic
So we can skip that
pieh
commented
Jan 19, 2023
| }, | ||
| params: input.params, | ||
| data: input.data || {}, | ||
| serverData: input.serverData, |
Contributor
Author
There was a problem hiding this comment.
this is entire fix, rest is just added tests and updated HeadProps type
pieh
marked this pull request as ready for review
January 19, 2023 11:58
LekoArts
approved these changes
Jan 19, 2023
This was referenced Jan 24, 2023
This was referenced Jan 25, 2023
This was referenced Jan 25, 2023
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.
Description
Pass
serverDataas prop (fromgetServerData) toHeadDocumentation
Related Issues
[ch-60342]
#35841 (comment)