I’m following the docs from Using the Render API | Learn Plasmic, and adding componentProps
and globalVariants
works, but if I want to render a page that has dynamic path params, I don’t find any way to add this to the call.
I can use a path instead of the component name (inside the URL “https://codegen.plasmic.app/api/v1/loader/html/preview/PROJECTID/COMPONENTNAME”), and it matches the correct component/page (seems like pages are just special components). So If I have a page located at /profile/[slug]
and I use the encoded string of “/profile/someuser”, it renders the right page – but the page itself has no $ctx.params.slug
set.
So 2 questions:
- why is the path correctly resolved but the page has no
$ctx.params.slug
? - how can I manually add it to the request in the way I’m using
componentProps
andglobalVariants
?
I tried to infer it from the plasmic code but it’s too nested.