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

Passing an array of objects as a prop #11

Closed
nonewcode opened this issue Apr 10, 2017 · 1 comment
Closed

Passing an array of objects as a prop #11

nonewcode opened this issue Apr 10, 2017 · 1 comment
Labels

Comments

@nonewcode
Copy link
Contributor

When i pass down [{}]. It works

When i pass down [{ id: 1 }]. It does not work.

What i've found is that you can pass down [{"1":1}] and that does work.

Is this intended?

@jennasalau
Copy link
Contributor

Hey Josh,

Thanks for taking the time to raise the issue.

Currently by design the framework will only parse valid JSON in prop attributes. If you want to use native javascript object syntax you may be better off using the data-r-prop.

The reason for this is most backend languages/systems are happy to convert data to JSON to populate the attributes.

In terms of resolving this issue.

I'm more than happy to investigate supporting native syntax if you can help me come up with a use case for it. I'm initially reluctant though as we would have to use eval which is usually viewed as an anti-pattern and raises security issues.

Did you find the docs confusing setting properties? Perhaps we can make changes to the docs so its more clear of whats expected?

Thanks
Jenna

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

No branches or pull requests

2 participants