-
Notifications
You must be signed in to change notification settings - Fork 381
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
RichText control doesn't render as a child component on a page #326
Comments
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible. |
Any updated on above request. When we are using componentWillReceiveProps or static getDerivedStateFromProps, it becomes very slow as it is being rendered. |
Hi @naveedullahk & @nileshlaxmi, Latest version (3.15.0) handles missing part of the state management for the RichText control. Is it working as expected now from your side? |
This issue has been automatically marked as stale because it has marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within next 7 days of this comment. Thank you for your contributions to SharePoint Developer activities. |
Closing issue due no response from original author. If this issue is still occurring, please open a new issue with additional details. Notice that if you have included another related issue as additional comment on this, please open that also as separate issue, so that we can track it independently. |
Category
[ ] Enhancement
[X] Bug
[ ] Question
Version 1.13.2
Expected / Desired Behavior / Question
Using RichText in a webpart, where it is used as a child component (field). the rich text should update the value (text displayed in the field) as soon as the state change occurs in the containing control (parent)
Observed Behavior
The RichText displays the value for the first time and then doesn't render the new value passed to it on subsequent renders.
Reviewing the code in RichText.tsx reveals that the props (value) being passed is only being assigned to the state (text) in the constructor. Subsequent render calls will not invoke the constructor and hence new value will not be updated in text. Missing componentWillReceiveProps lifecycle method
Steps to Reproduce
Create a component with a textbox, button and RichText control. In button click handler, set the value of textbox to the state which is passed to the RichText as props (value).
Please note that I tested the RichText after adding the method componentWillReceiveProps to the control and the issue seems to be fixed
`
public componentWillReceiveProps (nextProps:IRichTextProps){
this.setState({text:nextProps.value});
The text was updated successfully, but these errors were encountered: