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

"attributes" prop should be optional in ServerSideRender #7214

Closed
chrisvanpatten opened this issue Jun 7, 2018 · 0 comments · Fixed by #7229
Closed

"attributes" prop should be optional in ServerSideRender #7214

chrisvanpatten opened this issue Jun 7, 2018 · 0 comments · Fixed by #7229
Labels
Framework Issues related to broader framework topics, especially as it relates to javascript [Type] Bug An existing feature does not function as intended

Comments

@chrisvanpatten
Copy link
Member

Describe the bug
If you try to invoke ServerSideRender without an attributes prop, you get an error.

To Reproduce
Steps to reproduce the behavior:

  1. Create a block a block without attributes, rendered via a ServerSideRender component, like so: <ServerSideRender block="my/block" />
  2. See error: "Error loading block: Invalid parameter(s): attributes"

Expected behavior
If attributes isn't provided, it should be ignored inside ServerSideRender.

Workaround
It is possible to work around this by passing an empty value into attributes, such as <ServerSideRender block="my/block" attributes={{}} /> (and then obviously just ignore it in your render_callback).

@chrisvanpatten chrisvanpatten changed the title "attributes" should be optional in ServerSideRender "attributes" prop should be optional in ServerSideRender Jun 7, 2018
@danielbachhuber danielbachhuber added [Type] Bug An existing feature does not function as intended Framework Issues related to broader framework topics, especially as it relates to javascript labels Jun 14, 2018
@danielbachhuber danielbachhuber added this to the WordPress 5.0 milestone Jun 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Issues related to broader framework topics, especially as it relates to javascript [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants