What are you trying to do? (please be as specific as possible and include relevant screenshots, code snippets)
I am trying to update the html attribute (style) through state. Even though the values are getting updated in state. It is not reflecting on the page unless re-rendered.
This is what my state looks like. Lets say I am trying to update “backgroundColor”: “#ffffff” of the section. I am using color picker and on change interaction of color picker, I am running the code to update the state. Changes are very well reflected in the state. I have linked this state to a change the html attributes of a component lets say a column. It doesn’t reflect the changes unless I re-render the component.
TRY THIS. THIS EXPLAINS THE ISSUE IN SIMPLE TERMS
I have created a separate component to explain this
https://studio.plasmic.app/projects/u5enwxsNkAs5cmvjfcmPq4/-/test?arena_type=component&arena=sqkl9Io3VYDw
{
“sections”: [
{
“type”: “hero”,
“style”: {
“padding”: “20px”,
“textAlign”: “center”,
“backgroundColor”: “#ffffff”
},
“isVisible”: true,
“containers”: [
{
“style”: {
“margin”: “10px 0”,
“display”: “flex”,
“alignItems”: “center”,
“flexDirection”: “column”,
“justifyContent”: “center”
},
“blocks”: [
{
“type”: “vertical”,
“style”: {
“border”: “1px solid #ddd”,
“padding”: “10px”
},
“components”: [
{
“type”: “Heading”,
“style”: {
“color”: “#333”,
“fontSize”: “24px”,
“marginBottom”: “10px”
},
“content”: {
“text”: “Welcome to Our Marketplace”
}
},
{
“type”: “Paragraph”,
“style”: {
“color”: “#666”,
“fontSize”: “16px”,
“lineHeight”: “1.5”
},
“content”: {
“text”: “Find everything you need, from products to services, rentals to freelancers. Join our vibrant community today!”
}
}
]
},
{
“type”: “horizontal”,
“style”: {
“gap”: “10px”,
“display”: “flex”
},
“components”: [
{
“type”: “Button”,
“style”: {
“color”: “#fff”,
“border”: “none”,
“cursor”: “pointer”,
“padding”: “10px 20px”,
“borderRadius”: “5px”,
“backgroundColor”: “#007bff”
},
“content”: {
“link”: “/explore”,
“text”: “Start Exploring”
}
},
{
“type”: “Button”,
“style”: {
“color”: “#fff”,
“border”: “none”,
“cursor”: “pointer”,
“padding”: “10px 20px”,
“borderRadius”: “5px”,
“backgroundColor”: “#6c757d”
},
“content”: {
“link”: “/another-link”,
“text”: “Learn More”
}
}
]
}
]
},
{
“style”: {
“margin”: “10px 0”,
“display”: “flex”,
“alignItems”: “center”,
“flexDirection”: “column”,
“justifyContent”: “center”
},
“blocks”: [
{
“type”: “vertical”,
“style”: {
“border”: “1px solid #ddd”,
“padding”: “10px”
},
“components”: [
{
“type”: “Image”,
“style”: {
“width”: “100%”,
“height”: “auto”
},
“content”: {
“src”: “https://hounudmkadqhtgdtcjbc.supabase.co/storage/v1/object/public/images/14c8bda2-fb66-4fe0-81be-d4eb90b31fbb”
}
}
]
}
]
}
],
“sectionName”: “hero_section_1”
}
],
“Page-style”: {
“backgroundColor”: “#ede9e9”
}
}
What are the reproduction steps?
Relevant links:
- My project: Plasmic