Dynamic route doesn't have params #2217
Closed
andriiradkevych
started this conversation in
General
Replies: 1 comment
-
The async function MyPage(req: Request, ctx: RouteContext) {} Applying this to your code: - import { PageProps } from '$fresh/server.ts';
+ import { RouteContext } from '$fresh/server.ts';
import PostPage from 'components/Pages/Post/index.tsx';
- const Post = async (props: PageProps) => {
- console.log(props.params);
+ const Post = async (req: Request, ctx: RouteContext) => {
+ console.log(ctx.params);
return <PostPage data={data} />;
};
export default Post; It's one of my regrets to match the syntax with middlewares instead of sync components because naturally folks add the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
routes/[pageSlug].tsx
Created dynamic route , and try to get param by url
localhost:3000/something
, butprops.params
returnundefined
, what can be the reason ?Beta Was this translation helpful? Give feedback.
All reactions