We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm using textComponentProps to change the text color based on a light/dark theme in my app like this:
textComponentProps
textComponentProps={ { style: { color: themeStore.theme == "light" ? "#333" : "#d7d7d7" } } }
But when my theme changes, htmlview isn't updating with the new styles
The text was updated successfully, but these errors were encountered:
fix:
HTMLView.js
componentWillReceiveProps(nextProps) { if (this.props.value !== nextProps.value - || this.props.stylesheet !== nextProps.stylesheet) { + || this.props.stylesheet !== nextProps.stylesheet + || this.props.textComponentProps !== nextProps.textComponentProps) { - this.startHtmlRender(nextProps.value, nextProps.stylesheet); this.startHtmlRender(nextProps.value, nextProps.stylesheet, nextProps.textComponentProps); } }
- startHtmlRender(value, style) { + startHtmlRender(value, style, textComponentProps) {
in startHtmlRender(...)
+ if(textComponentProps) { + opts['textComponentProps'] = textComponentProps + } htmlToElement(value, opts, (err, element) => {
Sorry, something went wrong.
No branches or pull requests
I'm using
textComponentProps
to change the text color based on a light/dark theme in my app like this:But when my theme changes, htmlview isn't updating with the new styles
The text was updated successfully, but these errors were encountered: