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

update on componentDidUpdate #10

Closed
wants to merge 1 commit into from
Closed

update on componentDidUpdate #10

wants to merge 1 commit into from

Conversation

TymchenkoOleksandr
Copy link

@TymchenkoOleksandr TymchenkoOleksandr commented Jul 21, 2016

component does not updates when props.children changes until resize

@pablosichert
Copy link
Owner

When you change the children object reference passed in to the component, it will re-render anyway, which will invoke the getLines function inside the render method.

Note: Truncate will not re-render, when its children receive new props or re-render for whichever reason.

Did the changes you propose fix your scenario?
Would it be possible that you paste some relevant code of your usage, so I can reproduce it?

@TymchenkoOleksandr
Copy link
Author

TymchenkoOleksandr commented Jul 21, 2016

Truncate does not re-render sometimes on changed children object reference passed in to the component util resize
jul-21-2016 13-00-31

<Truncate ellipsis={<span>{'...'}</span>} lines={2} > {about} </Truncate>
'about' text was changed on render but truncate still render previous text until resize

@pablosichert
Copy link
Owner

What does your about variable contain? A plain string or a React component?

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.

2 participants