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

Allow 'readMoreText' to accept react components rather than strings #18

Closed
erwinleonardy opened this issue Feb 4, 2020 · 1 comment
Closed

Comments

@erwinleonardy
Copy link

Hi guys!

I am wondering if it is possible for you guys to let 'readMoreText' accept react components as props rather than strings?

Although it does allow me to pass a react element as the 'readMoreText' props, it is still showing me this error:

index.js:1 Warning: Failed prop type: Invalid prop readMoreText of type object supplied to ReadMoreReact, expected string.

Thank You!

@alexandersmanning
Copy link
Owner

This sadly cannot work for this type of component, please see: #12 (comment)

If all you care about is height of the component, it is trivial for you to implement this with CSS/in-line styling, in which a read button changes the height (in px or %)/removes in when clicked. I am considering making a secondary component to do so, given that it has been requested a few times.

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

2 participants