The team is now working on the WordPress Interactivity API. This unblocks the same UX Frontity framework enabled but directly in WordPress Core, fully compatible with the new Site Editor.
I am trying to update the state to a value sent by a button click (in this case a url), I am new to react so I’m having trouble working out what is the best practice here, if anyone could help explain I would be most grateful. I’m getting a “url is not defined” error so assuming the way I’m sending the props is not correct?
I also had that issue when I started with frontity. Its actually quite simple. All you need to do is this:
actions: {
theme: {
updateMixcloudLink: ({ state }) => (props) => {
//Do your thing with props
}
}
}
GL. Let me know if we can help with something else.
leonnockolds3
@ni.bonev Thankyou so much for taking the time to help, if you could be so kind to explain a bit further, is the syntax correct that I’m using on the button to send the props?
then updateMixCloudLink will be invoked as the component is rendered, not when you click it.
I hope that is not adding extra confusion.
Good luck
1 Like
leonnockolds5
@ni.bonev Nikolay, thank you so much for your help with this! This was the final piece I needed in order to finish up my site. All done and working exactly as I want it to