[QUESTION] model props updates duplicates the component #5375
Answered
by
artf
Yomna-Raouf
asked this question in
Q&A
-
Hey @artf I'm trying to build a custom component that gets data from an API that the user enters, user will also enter the API keys. Here is what I tried to implement this ( The problem with this is every time the prop value changes a new component gets added to the canvas and the old one doesn't get updated. )
|
Beta Was this translation helpful? Give feedback.
Answered by
artf
Sep 9, 2023
Replies: 1 comment 1 reply
-
You're appending the content to the entire page on the render with this part const content = await fetchProductData(...);
this.model.components(content); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Yomna-Raouf
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You're appending the content to the entire page on the render with this part
const component = editor.addComponents(content);
, I guess you want to update the current component...