Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-render after tagStyles changed #366

Closed
wants to merge 1 commit into from

Conversation

jorgemasta
Copy link
Contributor

Re-call this.parseDOM if the tagStyles changed.
Resolves #343

@huuchi207
Copy link

this works with the code:

import HTML from 'react-native-render-html';
import {generateDefaultTextStyles} from 'react-native-render-html/src/HTMLDefaultStyles';
<HTML html={this.state.answer} 
            imagesMaxWidth={AppDimensions.WINDOW_WIDTH} 
            baseFontStyle={{ fontSize: this.state.fontSize, fontFamily: 'SegoeUI' }}
            tagsStyles={generateDefaultTextStyles(this.state.fontSize)}

            /> 

Thank you so much!

@jsamr jsamr requested a review from Exilz July 4, 2020 18:50
@jsamr
Copy link
Collaborator

jsamr commented Jul 4, 2020

@Exilz LGTM

@jsamr jsamr added the is:looking good Ready to merge. label Jul 5, 2020
Copy link
Collaborator

@jsamr jsamr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done! See my comments.

@@ -84,7 +84,7 @@ export default class HTML extends PureComponent {
}

componentDidUpdate(prevProps, prevState) {
const { html, uri, renderers } = prevProps;
const { html, uri, renderers, tagsStyles } = prevProps;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you apply the same logic for classStyles? Would fix #377

@jsamr jsamr added is:waiting for feedback Waiting for OP input. and removed is:looking good Ready to merge. labels Jul 5, 2020
@jsamr jsamr linked an issue Jul 5, 2020 that may be closed by this pull request
@jsamr
Copy link
Collaborator

jsamr commented Jul 15, 2020

@jorgemasta I am going to rework and merge this one manually. Thanks for your contribution.

@jorgemasta
Copy link
Contributor Author

Thanks @jsamr ! I was trying to find time to carry out your recommendation

@jsamr
Copy link
Collaborator

jsamr commented Jul 15, 2020

@jorgemasta I'm planning for a minor release soon, that is why :-) Plus, I started to implement some tests, but we don't provide guidelines yet. I need to implement a few "exemplar" tests so that contributors can have a template. If you're up to make the change I requested soon, let's say before Friday, I can wait for you. Either cases, I'll add the tests.

@jsamr jsamr requested review from jsamr and removed request for Exilz July 15, 2020 12:53
@jsamr
Copy link
Collaborator

jsamr commented Jul 15, 2020

This PR has been manually merged into master with commit 6e2ed46.

@jsamr jsamr closed this Jul 15, 2020
@jsamr jsamr removed the is:waiting for feedback Waiting for OP input. label Jul 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Re-render html to change colors tagsStyles doesn't re-render
3 participants