How can i rerender a component on traits change ? #4423
Answered
by
artf
chapiaddis
asked this question in
Q&A
-
is there a way for a component to re-render forcefully or with built-in methods ? i want to rerender my component on traits change so whenever my traits updated i want to listen to the event like below and rerender it. model: {
default: { .... },
init() {
this.on('change:attributes:attribute-change', (e)=> {
// re-render the component here
console.log('This is the event', e)
}
}
} FYI: i am using grapes-react with grapesjs This is the event
|
Beta Was this translation helpful? Give feedback.
Answered by
artf
Jul 15, 2022
Replies: 1 comment
-
If it's necessary you can trigger rerender from the model in this way |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
chapiaddis
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If it's necessary you can trigger rerender from the model in this way
model.trigger('rerender')