Hi,
How can I get the value of the built-in text component so I can replace a template {name}
with a value in the state (state.name)?
Thanks,
Chester
Hi,
How can I get the value of the built-in text component so I can replace a template {name}
with a value in the state (state.name)?
Thanks,
Chester
Hey Chester, to interpolate variables from state, use data binding and template literals:
Pick the components from clicking on it or in the layers tab, then go to the data tab and bind to its text input:
Press on <>
to edit as code, then use JS template literals to return a value using any property on the state
Screenshot taken from this fiddle: Builder.io: Drag and drop page builder and CMS
Thank you so much @aziz !
How to store user input in state variable?