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

Pass page props to application wrapper #1153

Closed
wants to merge 1 commit into from

Conversation

shivjm
Copy link

@shivjm shivjm commented May 6, 2023

I wanted to add a footer whose content changes based on the current route, but the application wrapper is only passed the component. This PR adds the PageProps under a new page property. I’m a bit confused about whether this is the right approach, though.

render currently sets props per the docs and declares it as Record<string, unknown> to pass safely to h. Passing those props alongside Component works and passes type checking, but I’m not sure whether there’s a reason for the unknown or not, so I can’t tell whether I’ve broken something. (And I can’t run the tests because it keeps failing on account of the port being in use. No idea why. I’m on Windows, and I can see it succeeds in CI.)

@deer
Copy link
Contributor

deer commented May 7, 2023

Looks like a slightly more generic version of #599. I have a similar use case, so I'd love for something like this to get accepted.

@lucacasonato lucacasonato added the feat New feature or request label May 12, 2023
@iuioiua
Copy link
Contributor

iuioiua commented May 31, 2023

Closing in favour of #1229. Either way, thank you @shivjm 🙏🏾

@iuioiua iuioiua closed this May 31, 2023
@shivjm shivjm deleted the pass-page-props-to-app-wrapper branch June 1, 2023 06:41
@shivjm
Copy link
Author

shivjm commented Jun 1, 2023

Yup, that sounds good. I’m glad someone was able to implement it in a better way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants