Parse DOM after changing imagesMaxWidth#83
Parse DOM after changing imagesMaxWidth#83SoundBlaster wants to merge 1 commit intomeliorence:v3.6.0from
imagesMaxWidth#83Conversation
This commit improve `componentDidUpdate` behaviour and changing `imagesMaxWidth` prop causes a new render cycle through a DOM. It is useful for responsive `HTML` component. For example, if device orientation is changed it may causes an update of `imagesMaxWidth` value from parent component (as a result of `onLayout` callback) and if `HTML` uses custom `renderers` its internal logic requires update of `this.state.dom` value to trigger new `parseDOM`.
|
Hi, please give a feedback to this changes. |
|
Hi, sorry for the late response, I completely skipped both of your PRs. The thing is that some people reported the fact that the rendered HTML doesn't update when a re-render should be triggered (your example, hot reloading...). I guess there should be a better solution than checking for each of these particular conditions to trigger the re-render whenever it's needed. If I, or someone else, cannot fix this soon, I'll consider merging this. What do you think ? |
|
Hello! |
|
Interesting, I didn't think of orientation. But seemingly this should work together with prop's new value. |
|
I took some time to investigate this, and I came up with a solution that triggers a clean re-render after any prop change. See #95 |
This commit improve
componentDidUpdatebehaviour and changingimagesMaxWidthprop causes a new render cycle through a DOM. It is useful for responsiveHTMLcomponent. For example, if device orientation is changed it may causes an update ofimagesMaxWidthvalue from parent component (as a result ofonLayoutcallback) and ifHTMLuses customrenderersits internal logic requires update ofthis.state.domvalue to trigger newparseDOM.