-
Notifications
You must be signed in to change notification settings - Fork 161
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
Support for passing object props to components #541
Comments
@JayaKrishnaNamburu I'd like to help with this one. We need it for custom code generation. Could you please guide me? |
Sure paul, i am actually looking for use cases. That we need in real time. Like we can pass them, but how we are going to use them in attributes, styles and componenets receiving them as props. Defining these use-cases will be a great help |
Hi @MurakamiKennzo i believe you are looking at something like this - https://repl.teleporthq.io/?uidlLink=9d998e5a-49ef-4b39-974b-729465e514e3&flavor=React&style=CSS-Modules Unfortunately, |
Great! |
I find that if I skipValidation and write code like this, it'll be helpful: {
"name": "Simple Component",
"node": {
"type": "element",
"content": {
"elementType": "Button",
"semanticType": "Button",
"attrs": {
"variant": {
"type": "static",
"content": {
"x": 100,
"y": 100
}
}
},
"dependency": {
"type": "package",
"path": "@material-ui/core",
"version": "^4.11.2",
"meta": {
"namedImport": true
}
},
"children": [
"Button"
]
}
}
} It seems only validation type error. |
Yup @MurakamiKennzo it does the trick. But it currently works inly in |
Yes, It currently work fine for me.😊 |
While trying to reproduce #545 bug, i noticed that the currently we are able to pass an object type We can see there are So, while working on this. We need to consider two more things. [ ] - Validating the @Prop()\n' +
'> 13 | fields.header_1615241758160: string = "This whole area is clickable!";\n' Which is invalid. |
Right now, we can define a component with a propDefinition of type object
But when we actually pass a object as prop to a component, the validation fails, and we don't have support for using object props for styles and attributes.
Needs work in both validator and styles
With validator
When validator turned off
The text was updated successfully, but these errors were encountered: