modifyComponentProps not modifying the component props #2010
Unanswered
Adamduehansen
asked this question in
Help
Replies: 1 comment 1 reply
|
Hi @Adamduehansen , thanks for the submission. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Description
Hi. I'm facing an issue with the Placeholder component from the Next.js JSS package. I want to modify the props that is parsed into each rendering and I assume that
modifyComponentPropsis made for this purpose. Take this exampleI would assume that the rendering "SomeRendering" would have
anotherPropas a prop besides the usual (fields,rendering) when placed into this placeholder. It does not seem to work though.Looking at the code of the Placeholder component it looks like the
modifyComponentPropsthat I pass to the Placeholder component is never used:jss/packages/sitecore-jss-nextjs/src/components/Placeholder.tsx
Line 21 in 83f002f
I'm reminded that I experienced this once before and made a PR on this issue: #1668. Is this intended behaviour and no bug? If it is a bug, I'm all good if the PR is rejected and you make the changes yourself, but could you look into it? I'm currenly moving from JSS 21 to JSS 22 and the other way I worked around this issue last year seems to be broken now.
Additional information
If I add

modifyComponentPropsto the placeholder, it adds that prop to the props of the component inside the placeholder. This is a screenshot of the props of my component (the SitecoreContext prop looks unusual because the screenshot is from a Storybook story) andmodifyComponentPropsis added here:All reactions