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

ReadMore is not working with HTML children using react-native-render-html #37

Open
muhammadashfaq opened this issue Dec 17, 2020 · 3 comments

Comments

@muhammadashfaq
Copy link

I am using react-native-render-html within ReadMore but not working.

<ReadMore
              numberOfLines={3}
              renderTruncatedFooter={renderTruncatedFooter}
              renderRevealedFooter={renderRevealedFooter}
              onReady={handleTextReady}>
              <HTML
                html={serviceDetail?.post_content}
                baseFontStyle={{
                  fontFamily: family.Montserrat_Regular,
                }}
              />
            </ReadMore>

Any solution ?

@rockia
Copy link

rockia commented Dec 29, 2020

I was also exploring a solution for this, but I don't think this lib supports it as the child component is wrapped inside a <Text> component: https://github.com/expo/react-native-read-more-text/blob/master/index.js#L51-L59

Update:
I ended up just use a simple component state to show expanded full html view or collapsed version. It's not something fancy but it works. I could use animation library to show smooth transition later if the project requires such feature.

@fawaz-ahmed
Copy link

@muhammadashfaq can you try out this library

@XamBoy
Copy link

XamBoy commented Mar 17, 2021

Any Update on this issue .. I'm also facing the same

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

No branches or pull requests

4 participants