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

Check props.params for defined by default #169

Closed
annaf-dev opened this issue Apr 2, 2019 · 1 comment
Closed

Check props.params for defined by default #169

annaf-dev opened this issue Apr 2, 2019 · 1 comment
Assignees

Comments

@annaf-dev
Copy link

annaf-dev commented Apr 2, 2019

Is your feature request related to a problem? Please describe.

The initial problem occurs when I changed my JSS app to fit the Sitecore-first workflow. After that I created a Rendering Parameter in Sitecore and wanted to use it in the corresponding JSS component. It led to the error stating that the props.params are undefined. I asked in Slack and @kamsar pointed me out that the Layout Service won't return my params until I set a value. That worked but initially there is no value wanted.

Describe the solution you'd like

I would like to have props.params checked for defined by default, so the JSS component works even if there is no value set.

Additional information

I use JSS version 11.0.2 (with React) and a Sitecore 9.0.1 instance.

@annaf-dev annaf-dev changed the title Check props.params for defined by default Check props.params for defined by default Apr 2, 2019
@sc-dawidrutkowski sc-dawidrutkowski self-assigned this Sep 5, 2019
@sc-dawidrutkowski
Copy link
Collaborator

Starting from JSS 13 the params object will be present in the JSON response even if rendering doesn't have parameters assigned yet:

image

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

No branches or pull requests

2 participants