You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to customize the contents of the page's <head/> by setting a URL query — basically, I want to add a simple feature flag based on a GET parameter. I'm stuck because in my _app.tsx the component only expects AppProps and I don't know how to tie a custom handler into a mix to access the request from here:
/** @jsx h *//** @jsxFrag Fragment */import{Fragment,h}from"preact";import{AppProps}from"$fresh/server.ts";exportdefaultfunctionApp(props: AppProps){// …
So, how can I get the current request from inside the _app.tsx? I know that I can call props.Component() and while technically it works, TS tells me that's a no-no.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I want to customize the contents of the page's
<head/>
by setting a URL query — basically, I want to add a simple feature flag based on aGET
parameter. I'm stuck because in my_app.tsx
the component only expectsAppProps
and I don't know how to tie a custom handler into a mix to access the request from here:So, how can I get the current request from inside the
_app.tsx
? I know that I can callprops.Component()
and while technically it works, TS tells me that's a no-no.Any pointers would be appreciated. TIA!
Beta Was this translation helpful? Give feedback.
All reactions